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

[Feature Request] Custom sort order #182

Closed
VegethB opened this issue Mar 29, 2021 · 11 comments · Fixed by #259 or #271
Closed

[Feature Request] Custom sort order #182

VegethB opened this issue Mar 29, 2021 · 11 comments · Fixed by #259 or #271
Assignees
Labels
enhancement New feature or request

Comments

@VegethB
Copy link

VegethB commented Mar 29, 2021

Is your feature request related to a problem? Please describe.

I happen to find some series that I can't sort them (unless I change the file / folder name). It would be more convenient to be able to add a "sort order" parameter instead of having to rename the physical folders / files and then (logically) change the name.
image

Describe the solution you'd like

IMG Ex:

Komga:
image
Komga DB:
image
is my Komga database table.

Describe a small use-case for this feature request
Being able to reorder items without having to change the real name.
Ex:
Series that have a "saga" name that encloses a specific number of volumes (not necessarily continuation volumes:
Saga 1> from volume 1 to 20;
Saga 2> from volume 21 to 40;
or
Saga 1> Volume 1 - 4;
Saga 2> Volume 1 - 25;
In this case, saga 2 is a sequel but not a continuation of the previous volume 4

@VegethB VegethB added the enhancement New feature or request label Mar 29, 2021
@GlassedSilver
Copy link

Like so often, I can only reference iTunes as one of the best metadata managers out there. It certainly doesn't have everything, but I think it's power level is a solid ground base to accomplish a lot of stuff.

iTunes does have alternative sort titles and the like as well, this would be ideal here! Big fan of this suggestion!

Also, a little sidenote: I would suggest the sorting algorithm to not go digit by digit but number by number whereas a number is any chain of digits not interrupted by a dot, comma, semicolon, other special characters or letters. Or a space ( ). :)

The suggested feature would however still be useful whenever the sorting doesn't break due to numbers, but because the order should not be alphabetical when your personal preference is entirely different. (e.g. sort chronologically or by canon timeline, which often isn't necessary the release timeline :) )

@Leeingnyo
Copy link
Member

Leeingnyo commented Dec 20, 2021

Hi!

I would implement this feature :) a plan will be commented soon.

@GlassedSilver Hi, I couldn't understand your comment. for titles in title, it sorts them alphanumerically. we split a name of title to number and non-number (abc12-3foo456bar goes abc, 12, -, 3, foo, 456, bar) and compare the numbers as a number

Ah yes. we would use the same algorithm on this feature. don't worry.

@GlassedSilver
Copy link

Hi!

I would implement this feature :) a plan will be commented soon.

@GlassedSilver Hi, I couldn't understand your comment. for titles in title, it sorts them alphanumerically. we split a name of title to number and non-number (abc12-3foo456bar goes abc, 12, -, 3, foo, 456, bar) and compare the numbers as a number

Ah yes. we would use the same algorithm on this feature. don't worry.

The sort title basically acts as an override for sorting as opposed to how the title appears in the UI and meta-data tracking.

E.g.: Say you have Harry Potter movies and the titles include "Harry Potter and the Philosopher's Stone".

Obviously sorting these sorts of titles by the usual alphabetical approach will result in the problem of them being out of order.

What I'd do in iTunes is to - if I don't like renaming the titles to "Harry Potter 1 - and the Philosopher's Stone" (already looks hella icky!) - to leave the regular title field to itself and type "Harry Potter 1" into the sorting title field.

@Leeingnyo
Copy link
Member

oh sorry I was talking about this

Also, a little sidenote: I would suggest the sorting algorithm to not go digit by digit but number by number whereas a number is any chain of digits not interrupted by a dot, comma, semicolon, other special characters or letters. Or a space ( ). :)

I might misread something.
Yes, you're right. I would add another name field for a custom sorting

A plan:
the names for a custom sorting info

  • would be saved in the info.json temproray.
  • has the key-value structure ({ "a name of entry file": "a custom name for sorting" }).
  • has a global scope (it's not user specific info).
  • could be edited by admins.

in a title page (a book page), a 'Custom' up and down options would be added.
With custom sort option, entires that have custom name would be appeared firstly. i.e.

[sorted entries using custom sort name alphanumerically]
[sorted entries that have no custom sort name using auto / or its name alphanumerically]

so does reversed.

hmm.. as I know, there's no sorting option for titles (folders) in title now... we would resolve this first. I don't know if this is a design decision.
also there isn't a UI for editing title info either.

@hkalexling
Copy link
Member

@Leeingnyo You rock! I still need to find the time to review the other PR from you :-)

hmm.. as I know, there's no sorting option for titles (folders) in title now... we would resolve this first. I don't know if this is a design decision.

Yes, currently the sub-titles are not sorted. My rationale was that the number of sub-titles is usually small (at least in my use-case), so sorting them is not important (but certainly won't hurt).

in a title page (a book page), a 'Custom' up and down options would be added.

I guess we can add this to the default "Auto" sort option? When sorting, if an entry has a custom sort title, we would use that to sort, and otherwise, we would fall back to its actual title. If you don't add sort titles to the entries their order will stay the same, so this won't break the user expectation.

@Leeingnyo
Copy link
Member

@hkalexling It would be good that sorting titles is supported, for comfortable mind :) let me try to do it together. currently title sorting options in library page are "Auto", "Data Modified" and "Progress" and entry sorting options has "Name" and "Data Added" more. Adding both options for titles would be easy.

I guess we can add this to the default "Auto" sort option? When sorting, if an entry has a custom sort title, we would use that to sort, and otherwise, we would fall back to its actual title. If you don't add sort titles to the entries their order will stay the same, so this won't break the user expectation.

Sounds good! Then, custom sort title would be used in "Auto" and "Title" options, right? Is it needed that a mark shows that the title has a custom sort name in an item card UI? or should we show a custom sort name in somewhere?

@Leeingnyo Leeingnyo self-assigned this Dec 24, 2021
@Leeingnyo
Copy link
Member

Leeingnyo commented Dec 24, 2021

It's another question, should we use display_name for sorting in "Auto" and "Title"?

Never mind

@hkalexling
Copy link
Member

@Leeingnyo Thanks for taking on this 👍

custom sort title would be used in "Auto" and "Title" options, right?

I am not entirely sure what would be the best. I am thinking having a separate auto option is not necessary anymore. If I remember correctly, auto is pretty much sort by titles, but if there are numbers in the titles, we will try to sort by those numbers instead. I guess most users are using the auto mode as it's just a better version of title mode. But of course let me know what you think.

Is it needed that a mark shows that the title has a custom sort name in an item card UI? or should we show a custom sort name in somewhere?

I think it's OK for it to stay hidden. In Plex sort title is a separate field and it won't be shown in the UI.

DeepinScreenshot_select-area_20211224172933

@hkalexling
Copy link
Member

hkalexling commented Dec 24, 2021

So we will have three kind of titles

  • title: Can only be changed by renaming the underlying file.
  • display_name: Only used in UI, can be customized. Falls back to title when it's not set.
  • sort_title: Only used when sorting, can be customized, and won't be shown in the UI. Falls back to title when it's not set.

What do you think?

@Leeingnyo
Copy link
Member

Good! I worked with this!

@mango-assistant
Copy link

Hi there! The feature has been added in v0.25.0. Thanks for the feature request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants