-
Notifications
You must be signed in to change notification settings - Fork 56
Description
Describe the bug
When creating a smart list you can change a setting to limit the lists of books. This lists will be random until you refresh. The change log for v0.9.147 says:
- CHANGE: Smartlists with limit criteria are no longer randomized
The code doesn't seem to do that.
Default values are still set to Random
ComicRackCE/ComicRack.Engine/Database/ComicSmartListItem.cs
Lines 60 to 61 in 934d6a2
| [DefaultValue(ComicSmartListLimitSelectionType.Random)] | |
| public ComicSmartListLimitSelectionType LimitSelectionType |
| LimitSelectionType = ComicSmartListLimitSelectionType.Random; |
Exact Steps to Reproduce
Steps to reproduce the behavior:
- Create a Smart list
- Set a limit for that list
- Refresh (F5)
Version/Commit (check the about page, next to the version, for the string between brackets):
- Version: 0.9.180
- Commit: 934d6a2
Additional context
The code correctly checks the type of sorting
ComicRackCE/ComicRack.Engine/Database/ComicSmartListItem.cs
Lines 295 to 308 in 934d6a2
| switch (LimitSelectionType) | |
| { | |
| case ComicSmartListLimitSelectionType.SortedBySeries: | |
| enumerable = enumerable.ToList().OrderBy((ComicBook cb) => cb, new ComicBookSeriesComparer()); | |
| break; | |
| default: | |
| if (LimitRandomSeed == 0) | |
| { | |
| LimitRandomSeed = new Random().Next(); | |
| } | |
| enumerable = enumerable.OrderBy((ComicBook l) => l.Id).ToList().Randomize(LimitRandomSeed); | |
| break; | |
| case ComicSmartListLimitSelectionType.Position: | |
| break; |
The Default & Random have the same value
| public enum ComicSmartListLimitSelectionType | |
| { | |
| Position = 0, | |
| SortedBySeries = 1, | |
| Random = 2, | |
| Default = 2 |
And since the default value is set to Random it will never hit the code, unless manually changed in the database. If the value is set in the database, then changing the default wouldn't do anything. But since it's the default it is normally not saved so might impact less users. Adding a UI to change it might be possible.