OxygenCobalt / Auxio

A simple, rational music player for android
GNU General Public License v3.0
2.2k stars 149 forks source link

Playlists #36

Closed OxygenCobalt closed 1 year ago

OxygenCobalt commented 3 years ago

The current plan for playlists is a self-contained database with optional M4A exporting.

Auxio's playlist implementation will have:

Last added/top tracks don't benefit my usage, so they will be omitted.

The biggest hold-up with this feature is the sheer technical difficulty of it. Playlisting is far more complicated than it seems internally, especially when you want a bug-free implementation.

KraXen72 commented 2 years ago

this would be great, +1. also please ability to import from m3u (and possibly a button to refresh the playlist if the m3u file changes)

OxygenCobalt commented 2 years ago

also please ability to import from m3u (and possibly a button to refresh the playlist if the m3u file changes)

This will be added, however the flow with importing m3u files yet is not certain.

ludificorpayne commented 2 years ago

I didn't know where to post feedback but this app is fantastic, really the only reason I can't use it is because of playlists. once that's added this will be the best music app. looking forward to it!

OxygenCobalt commented 2 years ago

Glad you like the app @ludificorpayne, this feature is still a ways away though. I want to make the current music experience as good as possible before I go ahead with such a complex addition. Rushing a half-baked playlist feature just to be like Phonograph/Retro/Vanilla just isn't right.

kendfss commented 2 years ago

Custom user-defined playlists

Could you elaborate on this? Would creating playlists only allow for adding tracks one by one/by the id3 groups (album, artist, genre), or would we be able to define filters?

A built-in liked songs playlist

So we would be "liking" songs in the app, would it be implemented with a bool, or a star system?

OxygenCobalt commented 2 years ago

Would creating playlists only allow for adding tracks one by one/by the id3 groups (album, artist, genre), or would we be able to define filters?

The former, not the latter. I have no idea how a filter-based addition system would work.

So we would be "liking" songs in the app, would it be implemented with a bool, or a star system?

More like a playlist of songs that you "liked" in-app.

kendfss commented 2 years ago

filter-based addition system

In players like iTunes, and some versions of Foobar2000 the user can specify a database query whose results are saved as a playlist and updated automatically as the library evolves over time. So you could have a playlist for "liked" or "liked and less than 6 months old" or "unliked and less than six months old" or "jazz or rock but nothing by Pink Floyd" etc.

In iTunes they were called "Smart Playlists".

KraXen72 commented 2 years ago

this would be extremly cool but i imagine also technically really complex and pain to implement. i would be 100% for it tho.

kendfss commented 2 years ago

The older version is somewhat less challenging to implement/optimize/maintain and often enough because you can create one playlist that is the union/intersection/disjunction of others. old version

for comparison, the newer version: new version

I don't remember using it too well but I think the core idea from the newer one is either that you can query query-results, create parallel queries for a single playlist, or both. I've been sketching something out in go (I don't know Kotlin, yet). I'll translate if it's approved. I wrote it with respect to MySQL. Was there a settlement on a particular database technology since OP?

OxygenCobalt commented 2 years ago

Was there a settlement on a particular database technology since OP?

I was always going to go for SQLite, which is standard for android. While technically it's better to use Room, I've found that it increases compile times by ~3 times and has this weird issue where old database items are never removed, so I just use the more verbose method.

Thanks for the images by the way. Something like this would be an extremely far off feature however. I'd imagine that implementing the built-in Liked Songs playlist would allow me to at least have a framework for query-based playlists, however I feel like exposing it in the UI would be the largest problem, as it requires a ton of options and is probably really hard to cram intp a phone screen.

If I were to guess what my roadmap is for Auxio right now, it would be something like:

  1. Internal technical reworks and automatic re-scanning (The latter especially since I don't want to add new features with that assumption anymore)
  2. All the other backlogged features that are held up by 1 (ex. Artist Images)
  3. Normal playlists
  4. Weird end-game features like this or a new metadata engine
OxygenCobalt commented 2 years ago

I am very sorry this feature is taking very long to implement. It's easily one of the most technically challenging systems I've worked on, and I don't want to deliver a half-baked implementation for the sake of implementing playlists quickly. I don't really have an ETA on when I'll implement it.

KraXen72 commented 2 years ago

by me, take your time. I see there are a lot more technical things that have to be tackled for auxio to have a solid playback experience. I am ok to wait for this feature, because i know once it does come out it will already be solid and usable.
Thanks for your great work on auxio so far!

OxygenCobalt commented 2 years ago

Okay, I had the realization that much of the technical complexity of playists comes from liked songs, and not from playlists themselves. This is because liked songs are sort of a hybrid between library attributes and playlists, and I need to find a way I can implement them without really bad efficiency issues. I think I'll try to deliver a MVP of playlists first and then push liked songs further into the future.

KraXen72 commented 2 years ago

very nice! i'd like if playlists had in mind the m3u workflow (importing and refreshing from .m3u and .m3u8 files) from the start, rather than be an afterthought. not saying you should add it as the first thing, but if you could just keep it in mind when making the playlist system so it is easily extended to support this functionality in the future, that would be really good!! thanks in advance.

OxygenCobalt commented 2 years ago

Yeah, M3U import and export will be implemented, but playlists themselves won't be backed by M3U instances. This is because google has deprecated the MediaStore column for M3U, so I really don't want to use it (It's also quite buggy AFAIK).

KraXen72 commented 2 years ago

good good. well i didn't quite mean "backed up" as in constatnly synced to the m3u files, but if you could just remember where the m3u file was located in storage, and give the user an option to "refresh" the playlist by internally re-importing it. this would be useful because when i sync up my music and playlists from my pc (playlists are generated there through my tagger app), normally i'd have to delete and re-import all the playlists manually. this would make the whole process significantly easier.

again, this is not a feature that needs to come from the start with playlists, just something to keep in mind so as to not be impossible to add once the whole system is implemented.

OxygenCobalt commented 2 years ago

That requires the playlists database, which is deprecated. Besides, I really don't want to back playlists with someone as unstable and spec-dependent as a M3U file. An internal database with import and export is much easier to implement without android screeching at me.

KraXen72 commented 2 years ago

how do you mean? can't you just make a button that does the filesystem call to read and parse the m3u file again, overwriting the current playlist? basically just same as the import but without the need of selecting the path (to save time & also because you already have the path from first import)

you do not have to sync up or do whatever with the playlist after, the whole point is so "refreshing" a playlists (or multiple) doesent take extremly long

OxygenCobalt commented 2 years ago

Oh, okay. That makes more sense. That was already what I was planning from my playlist system.

OxygenCobalt commented 2 years ago

I think the last blocker for this should be #202. Playlists must use Auxio IDs, but the ID system really needs to be reworked to become more formalized, backwards-compatible, and reliable. Adding support for MusicBrainz IDs in particular will allow users to avoid a behavior where changing a song's metadata causes Auxio to "forget" it, which would be terrible for playlist functionality.

jethi commented 2 years ago

What about using directories for playlists ? Where Auxio performs move operations on files into directories representing playlists. The order of playlist can be managed by tags saved in SQLite. I am worried that making playlists would lock them in Auxio. Directories with songs are very portable. I come from using Newpipe and find its queue and playlist very intuitive. Especially clicking on music notification directly opening the queue instead of app general page.

jethi commented 2 years ago

Now that I think about it.. using directories and moving files is an expensive operation + what if a song needs to be in 2 playlists. Then for one playlist a reference would have to be used.. That does not seem right.

Anyway, please add an option to export playlists so they can be shared with friends... (Provided they have the music files too) The tag/hash should be same considering files are identical.

OxygenCobalt commented 2 years ago

Yeah, that's not practical at all. I have to remind people that for Auxio to work well on new devices, it is functionality limited to three types of storage:

There used to be a Playlists API, but it has not worked well for years and it was recently deprecated. There is no way I could even walk the directory structure like that in the first place. The only reason I have things like Artist Images lined up is because I have the image database, in which I could parse the path structure in order to emulate directory walking.

M3U is the open playlist format, and Auxio will support importing and exporting these files. I don't believe in making Auxio a walled garden in any capacity.

Donkey-Doug commented 2 years ago

VLC for android supports user defined playlists. It is open source and you might find some code useful.

OxygenCobalt commented 2 years ago

270 raised an interesting way of importing playlists by selecting a folder of music. I think I can do this without violating scoped storage, so why not.

amalka-ari commented 1 year ago

This! This is the only thing missing from your simple but awesome music player. Implement Playlist feature and it will be the perfect music player.

Thanks. Keep up the good work.

illdeletethis commented 1 year ago

Firstly, merry Christmas and thank you very much for your work! And agreed, playlists would be great to have, miss them occasionally. As someone who doesn"t really "like" stuff in my collection (i did already actively add it there after all), the split of mvp first, liked in the far future would work well

OxygenCobalt commented 1 year ago

Thanks for the support @amalka-ari and @illdeletethis.

As for updates: I swear, every time I get close to playlists I find another thing I need to work on. This time around it's list management. More or less, the detail UI is nowhere near equipped to handle playlists without severe UI jank. I'll need to work on that a bunch before I can start on playlists.

Offerel commented 1 year ago

Is there some sort of plan when we can expect or test the playlist features? Im completely fine when it's buggy, but using a m3u playlist with relative paths is a absolute must have for me.

OxygenCobalt commented 1 year ago

This is my primary goal right now, not working on anything but an MVP of this. #335 is needed simply to make using playlists bearable, and then I can start work on it. No ETA since I'm a workaholic college student that is often too busy to add stuff to this app, but I can describe each phase of the addition:

OxygenCobalt commented 1 year ago

Screenshot_20230320-170808_Auxio_Debug_1

Offerel commented 1 year ago

I have tested the debug apk as of today and could see a playlist. Where do the content of the playlist come from? I only ask, because I have exported a m3u file from within Strawberry on Linux with 600 songs and relative paths. Most other media players can use this playlist and I have all 600 songs in the specified sorting. I think Auxio don't use this as of now, since the current implementation use some internal playlist and I see only 43 files in the implementation.

If my wish will be supported in a later version, im fine with that. Also any other format with relative paths is welcome, as long as Strawberry can create it. I will keep an eye on this feature.

OxygenCobalt commented 1 year ago

I've only implemented playlists in the UI, everything else currently is "junk" data for testing. I will be busy for the next month and a half and will likely be unable to work further on playlists until then.

KraXen72 commented 1 year ago

atleast you can see how happy people are about this feature coming to the app 😁😁

Offerel commented 1 year ago

Yes, its the only feature i really miss. Away from that, this is by far the best player, including commercial players.

madenerrgy commented 1 year ago

Screenshot_20230320-170808_Auxio_Debug_1

Wow, this looks amazing! We're really wait your update with playlist creation.

I would like to take this opportunity to thank you so much for your efforts on this app! It's made with taste and without unnecessary garbage (like other apps). Strength and health to you, dude!

projjalm commented 1 year ago

So happy to see progress in this. I really can't express my respect to Alex for spending time on this ever missing feature besides every other thing in his life. Wishing great success to you, brother. ❤️

PranavBhattarai commented 1 year ago

Came here to comment on playlist, which I saw missing. Hope in 2023 this feature comes into action.

Love the project. Thank you.

OxygenCobalt commented 1 year ago

https://github.com/OxygenCobalt/Auxio/assets/65370175/278ddb22-8275-4b9a-a62e-42852bd343bd

ildar commented 1 year ago

awesome! have a version to test?

OxygenCobalt commented 1 year ago

The latest CI build should have this functionality @ildar. It's just missing playlist editing, persistence, and has a ton of rough edges.

ildar commented 1 year ago

Ah! tested that. Works nicely. Just needs to get to some "stable" point. I'd say, the minimal list of features to be added:

  1. Ability to delete a playlist
  2. Ability to delete an item. With the above you can release then add more features like moving items in a list etc. Just my IMHO. Thanks for your efforts!
OxygenCobalt commented 1 year ago

All of that is planned before release @ildar. My hope is that I'll be able to trivially port the queue editing system to the playlist view and implement song deletion and re-ordering in parallel.

OxygenCobalt commented 1 year ago

All fundamental playlist editing is now done.

https://github.com/OxygenCobalt/Auxio/assets/65370175/fe666e74-bec7-4ead-8783-3e3e32322c09

Remaining work is now polishing the existing implementation. Song editing in particular should look a lot better in final release.

OxygenCobalt commented 1 year ago

Playlists are now done. Download Auxio_Canary.zip to access the functionality early and bugtest it. Note that it is a debug build, so it will be noticeably more sluggish than normal. This will not be present in release.

Note that the initial playlist release does not include the following:

Additionally: Please refer to the bug report process if you find an issue. Simply saying there's a crash is not enough to help me fix issues.

A 3.1.0 release is expected soon as I can do some minor fixes/changes.

@foss- @ildar @KraXen72 @Donkey-Doug @amalka-ari @jethi @illdeletethis @madenerrgy @projjalm @PranavBhattarai

madenerrgy commented 1 year ago

https://bin.kv2.dev/~6469b4bee599576ea02c75e3

Latest CI sometimes crashes when I'm adding track to the playlist. Maybe this logs will help somehow.

But overall everything works great!

https://github.com/OxygenCobalt/Auxio/assets/77206030/36c1c7e9-793b-40e5-9e7c-a292797d0d31

OxygenCobalt commented 1 year ago

New APK, hopefully with the fixes for @madenerrgy's bug.

Auxio_Canary.zip

madenerrgy commented 1 year ago

New APK, hopefully with the fixes for @madenerrgy's bug.

Auxio_Canary.zip

Oh, thank you so much pro! This problem has indeed disappeared.

It only remains to work on the friezes when opening and animation ..

https://github.com/OxygenCobalt/Auxio/assets/77206030/ed859b11-8f4b-4f52-a3e7-078d9b089996

OxygenCobalt commented 1 year ago

It only remains to work on the friezes when opening and animation ..

The former is because of the debug build slowing down the amount of layouts. I do agree more animation for playlist editing would be good, but I'm holding on that until I can nail a good framework for that (Eye candy is frustratingly buggy on android). Expect that in a 3.2.0 release, which I'm planning to have a bunch of mild UX improvements. @madenerrgy

madenerrgy commented 1 year ago

Got it, thanks for your efforts :)