Skip to content

feat: add play functionality to library folder/index items#276

Merged
eddyizm merged 2 commits intoeddyizm:developmentfrom
antebudimir:main
Nov 23, 2025
Merged

feat: add play functionality to library folder/index items#276
eddyizm merged 2 commits intoeddyizm:developmentfrom
antebudimir:main

Conversation

@antebudimir
Copy link
Contributor

@antebudimir antebudimir commented Nov 20, 2025

Changes

  • Show a play icon on inner folders plus artist index items and start playback from there
  • Recursively gather every song in the folder tree before queueing, skipping video items
  • Keep the root music folder navigation-only so it behaves like before
  • Surface toast notifications for “collecting…” and “playing…” states

Server Support

  • Works on any backend that exposes either folder browsing or indexes (e.g., Gonic, Navidrome)
  • Still governed by the existing “Show music directories” preference

Screenshots

Screenshot_20251120_191909_Tempus Screenshot_20251120_191916_Tempus

- 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
@antebudimir
Copy link
Contributor Author

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.

@tknoeny
Copy link

tknoeny commented Nov 20, 2025

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.

@antebudimir
Copy link
Contributor Author

antebudimir commented Nov 20, 2025

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.

@eddyizm
Copy link
Owner

eddyizm commented Nov 21, 2025

Hi @antebudimir This is really cool!
I have another PR I need to get in first, as a refactor priority but this one will come in after that.

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 :-)

@antebudimir
Copy link
Contributor Author

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?

@eddyizm
Copy link
Owner

eddyizm commented Nov 21, 2025

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.

@antebudimir
Copy link
Contributor Author

You mean configurable by users? Something like an option in settings "Make folder playable if less than e.g. 50GB"?

@eddyizm
Copy link
Owner

eddyizm commented Nov 22, 2025

Hi @antebudimir ,
sorry for the delayed response. Yeah, some kind of configuration, just in case people have issues, they would not be forced to deal with it. I'm gonna test and focus on this a bit.

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.

@eddyizm
Copy link
Owner

eddyizm commented Nov 22, 2025

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?

@antebudimir
Copy link
Contributor Author

@eddyizm,

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.

@eddyizm
Copy link
Owner

eddyizm commented Nov 23, 2025

Makes sense. I was trying to move around without luck

As that seems to be the culprit.
I think if it does become an issue we can factor that method and leave your implementation as is.

I will get this in the next release, thanks!

@eddyizm eddyizm merged commit cfd7cf3 into eddyizm:development Nov 23, 2025
@antebudimir
Copy link
Contributor Author

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

@eddyizm
Copy link
Owner

eddyizm commented Nov 23, 2025

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 startQueue method that seems to have resolved the freezing, at least on my humble collection of tracks. When I publish, you can see if it helps on your end as well.

@antebudimir
Copy link
Contributor Author

Sounds good! I'll let you know as soon as I have the chance to try it out! 🙂

@antebudimir
Copy link
Contributor Author

Btw. interested to know how humble is your library? 😄

@eddyizm
Copy link
Owner

eddyizm commented Nov 23, 2025

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

@eddyizm
Copy link
Owner

eddyizm commented Nov 23, 2025

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!

@tknoeny
Copy link

tknoeny commented Nov 23, 2025

Was this merged in without the root level support? 😢

@eddyizm
Copy link
Owner

eddyizm commented Nov 23, 2025

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 ?

@antebudimir
Copy link
Contributor Author

No worries. 🙂
Glad I could contribute to Tempus since I use it daily. 🎶

Regarding your library: yeah, it's a bit on the thinner side for me 😄

@tknoeny
Copy link

tknoeny commented Nov 23, 2025

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.

skajmer added a commit to skajmer/tempus-polish-translation that referenced this pull request Nov 23, 2025
@Sevinfolds
Copy link
Contributor

No worries. 🙂 Glad I could contribute to Tempus since I use it daily. 🎶

Regarding your library: yeah, it's a bit on the thinner side for me 😄

My library is over 1 terabyte. Your added feature works great, I haven't noticed any issues. Thank you very much for your contribution!

@antebudimir
Copy link
Contributor Author

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 startQueue method that seems to have resolved the freezing, at least on my humble collection of tracks. When I publish, you can see if it helps on your end as well.

Yep, doesn't freeze anymore at all! Nicely done! 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants