PaulWoitaschek / Voice

Minimalistic audiobook player
GNU General Public License v3.0
2.42k stars 369 forks source link

Files of Audiobooks in Cloud Storage are sorted randomly #1921

Open samkottler opened 1 year ago

samkottler commented 1 year ago

Overview

If the files are named "Chapter 1.mp3" "Chapter 2.mp3" etc the app sorts them correctly except that the single digit numbers all come after the two digit numbers. If I rename the files to "1 - Chapter 1.mp3" "2 - Chapter 2.mp3" etc, the chapters are sorted correctly.

IMG_20230521_090443

How to reproduce

  1. Add a book with filenames named "Chapter 1.mp2" etc
  2. Chapters sorted incorrectly.

Version

7.0.12

Android Version

12

Device Model

Pixel 3a XL

PaulWoitaschek commented 1 year ago

Thanks for the report.

Could you send me:

PaulWoitaschek commented 1 year ago

I attempted to reproduce this here but couldn't c550c6eee738e84ea23e74f798f0cfff211240f9

If someone faces this as well, please send me files which reproduce this.

samkottler commented 1 year ago

Sorry for the delay. I'm sending the files now.

PaulWoitaschek commented 1 year ago

And does this reproduce for you with a folder that only contains these two files?

For me this is looking good:

image
samkottler commented 1 year ago

Yes. On my phone, even with just those two files, the are shown in the wrong order.

samkottler commented 1 year ago

Two more things I just noticed. First, the I'm using the Fdroid version of the app, but the beta google play version seems to work as expected. Second, my files are on nextcloud but if I manually copy them to a local folder, they are in the correct order. I don't know much about the android storage API, but is it possible something weird is going on there?

PaulWoitaschek commented 1 year ago

What do you mean by "Your files are on nextcloud". How did you add them?

samkottler commented 1 year ago

Nextcloud is a self-hosted cloud storage service. In Voice adding a folder from nextcloud looks exactly the same as adding a local folder, but I wonder if either the nextcloud app or Android is doing some kind of filename mangling.

DaniilVdovin commented 1 year ago

I think this problem is related to the use of cloud storage.

PaulWoitaschek commented 1 year ago

Yes, it is.

What I found so far:

Voice sorts chapters using their uri. The implementation is in the compareTo function of the ChapterId. This is not easily fixable as this would require to find a completely different way to sort the files.

paskalito commented 8 months ago

Thanks god! its not just me! I was going nuts about this for days and weeks now!

have been deletin my library, app data and app multiple times only adding one book, renaming files...

I can confirm this exact error.

but also have a "dirty workaround" if i add the book not by using the nextcloud picker,bit by "root>android>media>com.nextcloud...>...>..." it - just works heavenly sounds

also: if you add a folder through "cloud picker" it takes forever to add > because it actually triggers to download everything in the choosen folder first. (which let to 3 times almost killing my device because it ran full to 0bytes (and i did not see why)) could be a bug, could be a feature... it is prbly done by the "cloud api" but i thought its good to know...!