timdubbins / tap

An audio player for the terminal with fuzzy-finder.
MIT License
35 stars 2 forks source link

No audio files found/empty / Volume #3

Open LukeZBaker opened 1 year ago

LukeZBaker commented 1 year ago

If you have a sub-directory that doesn't have any audio files or is empty, tap refuses to play the album even though the directory has audio files. Obviously that sub-directory could be removed, but some people may have non-audio files in sub-directories e.g. cover images.

Ideally, tap could just silently ignore sub-directories without audio files and still play the audio files found in the directory?

BTW, volume control is implemented beautifully without affecting the cleanness of the interface. Maybe it would be good to save the volume level so output is at the same level when restarting tap?

timdubbins commented 1 year ago

Thanks for raising this issue.

Currently we're making the assumption that 'albums' are the leaf directories, that is that they don't contain subdirectories. I did this because it was an easy (and fast) way to sort lots of file paths. I added the directory 'depth' search for people that maybe have other categories like 'genre' or whatever, and then the 'tab' search acts as a good catch-all.

This approach doesn't work in the case that you point out as the cover art subdirectory is treated like an album. So the album won't appear in the 'album' search, and the subdirectory is loaded instead of the audio if you select it.

The options are:

Personally I like finding the empty directory so i can either clean it up or grab the missing audio. First option is good if it's fast. Maybe it will look like some combo of first and second option. Will have to play around with it...

timdubbins commented 1 year ago

This issue should be solved with v0.4.6. We now have a more thorough sort on startup. Didn't seem to effect startup times (actually, it seems to be a a slight improvement, although my benchmarking is pretty crude).

Empty directories are ignored, as per your suggestion, along with directories that contain non-audio only.

If a directory that contains a mix of audio and subdirectories is selected then the directory will appear again alongside the subdirectories. Selecting it again loads it into the player. These types of directories get classified as artist and album so we're not hiding any files.

LukeZBaker commented 1 year ago

This seems to be working really well.