museeks icon indicating copy to clipboard operation
museeks copied to clipboard

Auto-update library contents.

Open gen3vra opened this issue 6 years ago • 10 comments

If you add a song to the library it should update after some time in the music player.

gen3vra avatar May 06 '18 00:05 gen3vra

Hello :)

I am not sure to understand what you mean here, can you elaborate ?

martpie avatar May 06 '18 08:05 martpie

Of course!

I regularly update my music library outside of Museeks. Once I add a song to my music folder, Museeks does not detect that I have new music. I have to delete my library and rescan in order to add the new songs to the library.

gen3vra avatar May 08 '18 19:05 gen3vra

So first thing, you just have re-drag-and-drop your music folder and new music will be added (old tracks will stay).

About the auto-refresh, this could be interesting indeed, though low priority, let’s keep this open :)

martpie avatar May 08 '18 19:05 martpie

Okay, I might try to implement it myself.

gen3vra avatar May 08 '18 20:05 gen3vra

Related to: https://github.com/KeitIG/museeks/issues/338, this would need to be done first.

This was how things worked before, but I rewrote the way files are imported. I would need to re-implement the old way while keeping the new UI.

Once this is fixed, we would just need to define a rule of “when to rescan”. Then boom, done.

martpie avatar May 09 '18 05:05 martpie

I was thinking about this problem recently: it kind of defeat the "remove from library" feature: a file previous scanned and removed may be automatically re-added later 🤔

Introducing a blacklist would add more problems (how or when to clear it?).

Adding the discussion label so people who want to participate can bring their ideas/points of view.

martpie avatar Aug 22 '18 07:08 martpie

  1. Keep roots of imported directories in DB
  2. Check already imported files are still there and clean them up otherwise
  3. Scan roots for newly added files periodically/on-demand

2 and 3 need a good timing to kick in and preferably be performed in background not to sacrifice the UX

YurySolovyov avatar Aug 22 '18 08:08 YurySolovyov

If it's not imperative that museeks keeps the "remove from library" feature, I propose possibly removing it. I'm not really thinking of a situation where someone has a folder full of music that they want to add to museeks but don't want specific files in there. Additionally, they could always make a folder just for museeks.

Otherwise, this answer from stack overflow or something to differentiate files extremely quick of each file in something like a .txt file or database and checking that against each file they've elected to remove sounds good.

gen3vra avatar Aug 23 '18 16:08 gen3vra

Yes indeed, it all makes sense. I will do some research to see how other players handle that.

martpie avatar Aug 24 '18 09:08 martpie

possible solution would be adding functionality of sync folder(s). storing root path of sync folders all files would be added to library when adding the sync folder. chokidar can be used for watching the library while museeks is running importing and removing files accordingly. One issue is that syncing while the the app is not running is not possible with chokidar and it is needed to sync the library on each start of application witch introduces issue reading songs removed from library (if i understand correctly library is currently basically table of paths to files). I see 3 solutions to keep library synced and avoid adding removed song from library When starting chokidarsy

  1. Remove the audio file when it is removed from museeks (this does not seam in the spirit of how is the library currently managed)
  2. Creating blacklist for the folder
  3. Adding hide flag to the database making songs witch are in sync folder still in database but hidden from library

Solution 2) has potential of introducing issues, however creates possibility of excluding whole folders instead of single files like in solution 3), however i do not thing that this functionality would be used much

Dongalis avatar Jul 24 '21 16:07 Dongalis