[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.

Track edits make it into the database/elasticsearch

KH (Oct 9, 2017, 10:26 PM +0200) 9bea6cd2 6f5d8aaa

+120 -41
+5 -1
README.md
··· 2 2 Some (to-be) web/desktop/mobile application for your music library. Oh, and it's my first project with Docker. My first project with Node.js as well. Oh, also the first project using GitLab. And the first one where I use Jade. The first one where I build a RESTful API too, in fact. 3 3 4 4 ## ToDo 5 + 6 + ### Short-term 7 + - Make track edits change file metadata 8 + - Double-click to reset sidebar width 9 + 5 10 - Account 6 11 - Email verification 7 12 - Change password 8 13 - Device management? 9 14 - Search 10 15 - Queue 11 - - Double-click to reset sidebar(/column?) sizes 12 16 - Column sorting 13 17 - Custom context menus 14 18 - Account/settings
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.

+30 -33
db/data/ib_buffer_pool
··· 1 - 4294967278,336 2 - 4294967279,403 3 - 4294967279,402 4 - 4294967278,335 5 - 4294967279,401 6 - 4294967279,400 7 - 4294967278,334 8 - 4294967279,399 9 - 4294967278,333 10 - 4294967279,398 11 - 4294967279,397 12 - 4294967278,332 13 - 4294967278,331 14 - 4294967278,330 15 - 4294967278,329 16 - 4294967278,328 17 - 4294967278,326 18 - 4294967279,396 19 - 4294967278,325 20 - 4294967293,132 21 - 4294967279,395 22 - 4294967279,394 23 - 4294967278,324 1 + 4294967278,342 2 + 4294967278,341 3 + 4294967278,339 4 + 4294967279,404 24 5 4294967293,131 25 6 4294967293,130 26 7 4294967293,129 ··· 152 133 4294967293,3 153 134 4294967293,2 154 135 4294967293,0 155 - 4294967278,173 156 - 4294967278,44 157 136 4294967278,274 158 137 4294967278,172 159 138 4294967278,43 ··· 226 205 4294967278,436 227 206 4294967278,149 228 207 4294967278,20 229 - 4294967278,401 230 208 4294967278,148 231 209 4294967278,19 232 210 4294967278,435 ··· 244 222 4294967278,408 245 223 4294967278,143 246 224 4294967278,14 247 - 4294967278,404 248 225 4294967278,142 249 226 4294967278,13 250 227 4294967278,402 ··· 259 236 4294967278,407 260 237 4294967278,138 261 238 4294967278,9 262 - 4294967278,390 239 + 4294967278,336 263 240 4294967278,137 264 241 4294967278,8 265 242 4294967278,422 ··· 268 245 4294967278,302 269 246 4294967278,135 270 247 4294967278,6 271 - 4294967278,378 248 + 4294967278,333 272 249 4294967278,134 273 250 4294967278,5 251 + 4294967278,325 274 252 4294967278,133 275 253 4294967278,4 276 254 4294967278,3 ··· 278 256 4294967279,239 279 257 4294967279,132 280 258 4294967279,445 281 - 4294967279,285 259 + 4294967279,398 282 260 4294967279,131 283 261 4294967279,417 284 - 4294967279,416 262 + 4294967279,403 285 263 4294967279,130 286 264 4294967279,415 287 - 4294967279,284 265 + 4294967279,397 288 266 4294967279,129 289 267 4294967279,283 290 268 4294967279,315 291 269 4294967279,128 292 - 4294967279,451 270 + 4294967279,402 293 271 4294967279,414 294 272 4294967279,127 295 273 4294967279,413 ··· 298 276 4294967279,461 299 277 4294967279,412 300 278 4294967279,125 279 + 4294967279,460 280 + 4294967279,308 281 + 4294967279,124 282 + 4294967279,493 283 + 4294967279,279 284 + 4294967279,123 285 + 4294967279,307 286 + 4294967279,278 287 + 4294967279,122 288 + 4294967279,457 289 + 4294967279,276 290 + 4294967279,121 291 + 4294967279,235 292 + 4294967279,275 293 + 4294967279,120 294 + 4294967279,400 295 + 4294967279,274 296 + 4294967279,119 297 + 4294967279,306
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/tablespaces.open.1

This is a binary file and will not be displayed.

db/data/tablespaces.open.2

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.

+47
web/src/modules/routes.js
··· 602 602 } 603 603 } 604 604 605 + module.exports.editTrack = (req, res) => { 606 + if (res.locals.loggedIn) { 607 + let trackId = req.body.trackId; 608 + let metadata = { 609 + name: req.body.name, 610 + artist: req.body.artist, 611 + album: req.body.album, 612 + genre: req.body.genre 613 + }; 614 + let tracksQuery = ` 615 + UPDATE 616 + tracks 617 + SET 618 + ? 619 + WHERE 620 + trackId = ? 621 + AND userId = ?`; 622 + let args = [metadata, trackId, res.locals.userId]; 623 + db.query(tracksQuery, args, (err, result) => { 624 + if (err) { 625 + jsonRes(res, "err", 12001); 626 + } else { 627 + console.log(trackId); 628 + elastic.update({ 629 + index: "catalog", 630 + type: "track", 631 + id: trackId, 632 + body: { 633 + doc: { 634 + trackId: metadata.trackId, 635 + name: metadata.name, 636 + artist: metadata.artist, 637 + album: metadata.album, 638 + genre: metadata.genre, 639 + } 640 + } 641 + }).then((body) => { 642 + jsonRes(res); 643 + }, (err) => { 644 + console.log(err); 645 + jsonRes(res, "err", 12002); 646 + }); 647 + } 648 + }); 649 + } 650 + } 651 + 605 652 module.exports.reviveTrack = (req, res) => { 606 653 if (res.locals.loggedIn) { 607 654 let trackId = req.body.trackId;
+1
web/src/server.js
··· 71 71 // tracks 72 72 app.post("/upload-tracks", routes.uploadTracks); 73 73 app.post("/delete-track", routes.deleteTrack); 74 + app.post("/edit-track", routes.editTrack); 74 75 app.post("/revive-track", routes.reviveTrack); 75 76 app.post("/get-track-info", routes.getTrackInfo); 76 77 app.post("/increment-track-play-count", routes.IncrementTrackPlayCount);
+37 -7
web/src/static/global.js
··· 335 335 }; 336 336 window.editTrack = function(trackId) { 337 337 var dialog = document.querySelector(".dialogs .dialog.editTrack"); 338 - dialog.querySelector(".trackName").value = tracklist[trackId].name; 339 - dialog.querySelector(".trackArtist").value = tracklist[trackId].artist; 340 - dialog.querySelector(".trackAlbum").value = tracklist[trackId].album; 341 - dialog.querySelector(".trackGenre").value = tracklist[trackId].genre; 342 - dialog.querySelector(".trackBitrate").innerHTML = "Bitrate: "+tracklist[trackId].bitrate; 343 - openDialog("editTrack"); 338 + var name = dialog.querySelector(".trackName"); 339 + var artist = dialog.querySelector(".trackArtist"); 340 + var album = dialog.querySelector(".trackAlbum"); 341 + var genre = dialog.querySelector(".trackGenre"); 342 + var bitrate = dialog.querySelector(".trackBitrate"); 343 + name.value = tracklist[trackId].name; 344 + artist.value = tracklist[trackId].artist; 345 + album.value = tracklist[trackId].album; 346 + genre.value = tracklist[trackId].genre; 347 + bitrate.innerHTML = "Bitrate: "+tracklist[trackId].bitrate; 348 + 349 + openDialog("editTrack", null, null, null, function() { 350 + perform(); 351 + }); 352 + function perform() { 353 + var req = "trackId="+trackId+ 354 + "&name="+encodeURIComponent(name.value)+ 355 + "&artist="+encodeURIComponent(artist.value)+ 356 + "&album="+encodeURIComponent(album.value)+ 357 + "&genre="+encodeURIComponent(genre.value); 358 + console.log(req); 359 + console.log("saaave"); 360 + xhr(req, "/edit-track", function(res) { 361 + res = JSON.parse(res); 362 + if (res.errors) { 363 + notify("An unknown error occured while editing the track", true); 364 + } else { 365 + console.log(res); 366 + } 367 + }); 368 + } 344 369 } 345 370 window.deleteTrack = function(trackId) { 346 371 var req = "trackId="+trackId; ··· 527 552 confirmTitle.innerHTML = title; 528 553 confirmDescription.innerHTML = description; 529 554 confirmButton.innerHTML = confirmText; 555 + } 556 + if (callback) { 530 557 confirmCallback = callback; 558 + } 559 + else { 560 + confirmCallback = function(){}; 531 561 } 532 562 dialog.classList.add("visible"); 533 563 var focusThis = dialog.querySelector(".focus-this"); ··· 549 579 var name = dialog.querySelector(".name").value; 550 580 var description = dialog.querySelector(".description").value; 551 581 createPlaylist(name, description); 552 - } else if (cl.contains("confirm") && cl.contains("primary")) { 582 + } else if (cl.contains("primary")) { 553 583 closeDialog(); 554 584 confirmCallback(); 555 585 }