[READ-ONLY] Mirror of https://github.com/probablykasper/ferrum. Music library app for Mac, Linux and Windows ferrum.kasper.space
electron linux macos music music-library music-player napi windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Playing song's cover is shown in player. When uploading, the filename will be used as title if there is no title metadata

KH (Oct 7, 2017, 8:13 PM +0200) 6f5d8aaa 070481eb

+13 -5
db/data/ferrum/sessions.ibd

This is a binary file and will not be displayed.

db/data/ferrum/tracks.ibd

This is a binary file and will not be displayed.

db/data/ib_logfile0

This is a binary file and will not be displayed.

db/data/ibdata1

This is a binary file and will not be displayed.

db/data/ibtmp1

This is a binary file and will not be displayed.

db/data/mysql.ibd

This is a binary file and will not be displayed.

db/data/undo_001

This is a binary file and will not be displayed.

db/data/undo_002

This is a binary file and will not be displayed.

web/src/covers/qjmwd3u3qr

This is a binary file and will not be displayed.

+8 -4
web/src/modules/routes.js
··· 465 465 return `${YYYY}-${MM}-${DD} ${hh}:${mm}:${ss}`; 466 466 } 467 467 } 468 - function insertTrack(req, res, filepath, trackId, callback) { 468 + function insertTrack(req, res, filepath, trackId, originalFilename, callback) { 469 469 getMD(filepath, (err, value, image) => { 470 470 if (err) { 471 471 callback(err); 472 472 } else { 473 + if (value.name == "") { 474 + value.name = originalFilename; 475 + } 473 476 value.trackId = trackId; 474 477 value.userId = res.locals.userId; 475 478 value.dateAdded = getCurrentDate("sql"); ··· 541 544 if (err) { 542 545 errors.push({ 543 546 code: err, 544 - track:trackNumber 547 + track: trackNumber 545 548 }); 546 549 } 547 550 if (uploadedCount == req.files.length) { 548 551 if (errors.length > 0) { 549 - jsonRes(res, "err", errors) 552 + jsonRes(res, "err", errors); 550 553 } else { 551 554 jsonRes(res); 552 555 } ··· 555 558 for (var i = 0; i < req.files.length; i++) { 556 559 var path = req.files[i].path; 557 560 var trackId = req.files[i].trackId; 558 - insertTrack(req, res, path, trackId, function(err) { 561 + var originalFilename = req.files[i].originalname; 562 + insertTrack(req, res, path, trackId, originalFilename, (err) => { 559 563 oneUploaded(err, i+1); 560 564 }); 561 565 }
+5 -1
web/src/static/global.js
··· 1164 1164 1165 1165 var playPauseIcon = document.querySelector(".player .icon.play-pause"); 1166 1166 function updateMetaData(trackId) { 1167 + // artist/title 1167 1168 var TrackInfoName = document.querySelector(".player .left .name"); 1168 1169 var TrackInfoArtist = document.querySelector(".player .left .artist"); 1169 1170 document.title = tracklist[trackId].artist+" - "+tracklist[trackId].name; 1170 1171 TrackInfoName.innerHTML = tracklist[trackId].name; 1171 1172 TrackInfoArtist.innerHTML = tracklist[trackId].artist; 1173 + // cover 1174 + var cover = document.querySelector(".player img.cover"); 1175 + cover.setAttribute("src", "/cover/"+trackId); 1172 1176 } 1173 1177 window.setSrc = function(trackId) { 1174 1178 if (!tracklist[trackId]) { ··· 1176 1180 xhr(req, "/get-track-info", function(res) { 1177 1181 res = JSON.parse(res); 1178 1182 tracklist[trackId] = res.track; 1179 - updateMetaData(); 1183 + updateMetaData(trackId); 1180 1184 }); 1181 1185 } else { 1182 1186 updateMetaData(trackId);