Skip to content

Conversation

@rien333
Copy link

@rien333 rien333 commented Aug 16, 2025

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

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

@rien333
Copy link
Author

rien333 commented Aug 16, 2025

Sorry for the force push, I didn't have GPG signing setup yet.

@OxygenCobalt
Copy link
Owner

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 }))
Copy link
Owner

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.

Copy link
Author

@rien333 rien333 Sep 15, 2025

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?

Copy link
Owner

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

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.

2 participants