Skip to content
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

fix sort for dir, tracks #512

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

mikuta0407
Copy link

In the current implementation, if the file names are as follows, they will be output in the expected order when the client displays the list.

01 aaa.mp3
02 bbb.mp3
...
10 jjj.mp3
11 kkk.mp3
...
20 ttt.mp3
21 uuu.mp3

However, if the leading zero is not as shown below, iSub and Jamstash will sort by string instead of by track number.

1 aaa.mp3
2 bbb.mp3
...
10 jjj.mp3
11 kkk.mp3
...
20 ttt.mp3
21 uuu.mp3

1 aaa.mp3
10 jjj.mp3
11 kkk.mp3.
...
2 bbb.mp3
20 ttt.mp3
21 uuu.mp3

This was resolved by inserting sort.

Also, DSub (Android) and others have a function to sort and display albums based on the release year value in the album list, but since Year is not stored when NewTCAlbumByFolder is executed in the GET /getMusicDirectory process, the value is not included in the HTTP response and year sorting is not possible, so this has been fixed.

@mikuta0407
Copy link
Author

Oops... the test failed... I'll look into fixing that later.

@sentriz
Copy link
Owner

sentriz commented Jun 8, 2024

maybe we could just add an extra Order() to sort?

@mikuta0407
Copy link
Author

As you pointed out, adding the order solved the problem. I added a commit in the fixup, so if there are no problems, I will squash it.
mikuta0407@e093113

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