-
-
Notifications
You must be signed in to change notification settings - Fork 205
feat: share songs in album order #1174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
Signed-off-by: Rijnder Wever <[email protected]>
Signed-off-by: Rijnder Wever <[email protected]>
|
Sorry for the force push, I didn't have GPG signing setup yet. |
|
Thanks for the contribution! Sorry for the delay. |
| fun Context.share(parent: MusicParent) { | ||
| if (parent is Album) { | ||
| // share songs in album order | ||
| val sorted = parent.songs.sortedWith(compareBy({ it.disc ?: 0 }, { it.track ?: 0 })) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend taking a look at the Sort class rather than doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that is indeed cleaner. It also got me thinking that running Sort(Sort.Mode.ByAlbum, … ).songs(songs) on every share may not be such a bad idea after all. For example, I sometimes want to share ("cast") a subset of songs from an album, and with the current implementation, they would be delivered out of order. You could also make a case for this kind of sorting when sharing an artist's discography — but I may be biased by my own listening habits here.
Of course, there are also MusicParents where this kind of sort doesn't make a lot of sense (e.g. genres). I don't think it would bother people much, though. At least, I know that Kodi has a shuffle mode if you really want things randomized.
Do you have an opinion here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in this case when sort order is vague I try to use the sort order user preference in MusicSettings, albeit it's a bit nontrivial to use in this context (you likely would have to expose it in relevant ViewModels for it to be approvable.
Just sorting:
- By track if
Album - By album if
Artist - By genre if
Genre
Would probably be good here if you want to make those changes @rien333
What is it?
Description of changes
When sharing an album (and only when sharing an album), Auxio now shares the songs in album order.
The reasoning here is that if a user shares an album to an other app, such as a streaming app, the user probably wants that app to play/consume these tracks in album order. Before this change, the order appeared random on the end of the receiving app.
I've thought about adding sorting to other types of
MusicParent, but they all lack a natural ordening, IMO.Fixes the following issues
Somewhat related to #379. I've wanted to switch to Auxio for a long time (to go 100% FOSS), but I'm incredibly accustomed to casting stuff from my phone.
Then I realized that since Auxio can share collections of files to Kore (a Kodi remote app), and since Kore can in turn stream files over http to Kodi, you basically have rudimentary FOSS casting.
In my test, this whole chain works pretty great!
For the whole plan to go through, however, the Kore devs still need to approve a pull request (xbmc/Kore#1043).(relevant external PR was merged)Any additional information
Thanks for developing Auxio!
APK testing
app-debug.apk.zip
Due Diligence