feat: add play functionality to library folder/index items#276
feat: add play functionality to library folder/index items#276eddyizm merged 2 commits intoeddyizm:developmentfrom
Conversation
- add play button to inner folders in library - implement recursive song collection from folders and subfolders - filter out video files, play only audio tracks - add user feedback with toast notifications
|
Hello! 🙂 Finally got to dedicating some time to Tempus. After implementing the same functionality in Feishin, I did the same for Tempus. Triggering playback directly from folders is something I find very useful. Have a look if you like it. |
|
This is awesome! Quick question though, can we not support the play button on the root folder? This would be useful for people (me) who have multiple libraries on their server and want an easy way to play one. Would be a nice workaround until library filtering is implemented. |
|
Sure we can! 🙂 I intentionally didn't implement it for the root folder because my use case is a single library folder with genre subfolders in it (as can be seen in the screenshots). I'll implement it tomorrow or Saturday, depending on the time. |
|
Hi @antebudimir This is really cool! The only question I have before I dig into the code would be how many files and folders you have. A lot of our issues are performance related and not handling large libraries efficiently so we want to be careful. I tend to not have too many issues but apparently my library is rookie status :-) |
|
Hi @eddyizm, Glad you like it. No worries. You merge yours first, and if any merge conflicts arise with mine then, I'll sort them out. Now you mention it, that was the second reason I didn't leave the play button on the root music folder - my library is 1Tb and it was spinning too long trying to enqueue. What do you think about it in that case? |
|
Depending on the device, it could crash. Maybe we can profile it and set a configurable upper limit ? That and putting it off the ui thread are my first thoughts, but let's think about it. |
|
You mean configurable by users? Something like an option in settings "Make folder playable if less than e.g. 50GB"? |
|
Hi @antebudimir , could be nothing to worry about but large libraries, either by disk size or most likely number of files could cause unintended consequences. On the bright side, the refactor was focused on cleaning up and consolidating the media service so your PR would not be affected. |
|
OK, this is really neat in practice. This seems like it is dependent on library folder structure, I saw it freezing up on a folder with about 2k+ tracks. (My library is alphabetical, A-Z/artist/albums) Without debugging, it seems to pull the list of tracks in the background but locked up when actually populating the Playlist. I'm gonna try and rebase against dev as we also have a couple of prs to address performance issues. I may combine all pf them to test. One question that I'm sure I would test, what does the user see when the backend does not support folder view? Assuming that view just doesn't show up in the library right? |
|
Thanks for testing! 🙂 My biggest folder inside the library is 200Gb with 5800 songs. Takes about 5s to collect songs (during which it freezes for like 2s) and start playing. Regarding backends without folder support - mind you, I didn't implement the library as such. It was already there. 🙂 I use Navidrome as well, so I can confirm it works fine because it exposes artist/album indexes even though it doesn't mirror the raw directory tree. I don't know about the others, but I'd assume that the "Music folders" section simply doesn't appear in the Library view. The feature is already gated by the existing "Show music directories" setting in Tempus. |
|
Makes sense. I was trying to move around without luck As that seems to be the culprit. I will get this in the next release, thanks! |
|
Thanks @eddyizm ! I'll have another one soon, but more on that in the discussions section these days, because I'll need a design approval since it's a new toggle in the main UI playback controls area. 😉 |
I did a refactor of the |
|
Sounds good! I'll let you know as soon as I have the chance to try it out! 🙂 |
|
Btw. interested to know how humble is your library? 😄 |
|
i think my working library is under 19k tracks. (I have another library with bootlegs and stuff that is not sorted or added into my server and may never be) published on 4.3.0 |
|
btw - in my excitement of this neat feature i failed to thank you, deeply thank you, for adding to the documentation and making this a top tier PR to review and understand! |
|
Was this merged in without the root level support? 😢 |
yes. let's see what kind of response we get with this. The minor update I made should hopefully improve responsiveness but as I mentioned, my library is apparently small compared to folks with a million tracks. That seems to break everything in the app as it can't handle that volume and needs major refactor to address it. What is your library size ? |
|
No worries. 🙂 Regarding your library: yeah, it's a bit on the thinner side for me 😄 |
|
Ah I see, my library is 6k total split across two main folders (5k/1k split). Perhaps not the right place for this topic but I don't think the app is caching aggressively enough which would resolve a lot of perf issues, that along with pagination. I think a discussion thread would be good for this topic specifically. |
My library is over 1 terabyte. Your added feature works great, I haven't noticed any issues. Thank you very much for your contribution! |
Yep, doesn't freeze anymore at all! Nicely done! 🍻 |
Changes
Server Support
Screenshots