Skip to content

Commit

Permalink
Merge pull request #1517 from 1hitsong/sortByRandom
Browse files Browse the repository at this point in the history
Add Random sorting to supported libraries
  • Loading branch information
1hitsong authored Dec 29, 2023
2 parents c0c25d2 + cdb73e5 commit 7e3a234
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
6 changes: 5 additions & 1 deletion components/ItemGrid/ItemGrid.bs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ sub setMoviesOptions(options)
{ "Title": tr("OFFICIAL_RATING"), "Name": "OfficialRating" },
{ "Title": tr("PLAY_COUNT"), "Name": "PlayCount" },
{ "Title": tr("RELEASE_DATE"), "Name": "PremiereDate" },
{ "Title": tr("RUNTIME"), "Name": "Runtime" }
{ "Title": tr("RUNTIME"), "Name": "Runtime" },
{ "Title": tr("Random"), "Name": "Random" },
]
options.filter = [
{ "Title": tr("All"), "Name": "All" },
Expand All @@ -275,6 +276,7 @@ sub setBoxsetsOptions(options)
{ "Title": tr("DATE_ADDED"), "Name": "DateCreated" },
{ "Title": tr("DATE_PLAYED"), "Name": "DatePlayed" },
{ "Title": tr("RELEASE_DATE"), "Name": "PremiereDate" },
{ "Title": tr("Random"), "Name": "Random" },
]
options.filter = [
{ "Title": tr("All"), "Name": "All" },
Expand All @@ -299,6 +301,7 @@ sub setTvShowsOptions(options)
{ "Title": tr("DATE_PLAYED"), "Name": "DatePlayed" },
{ "Title": tr("OFFICIAL_RATING"), "Name": "OfficialRating" },
{ "Title": tr("RELEASE_DATE"), "Name": "PremiereDate" },
{ "Title": tr("Random"), "Name": "Random" },
]
options.filter = [
{ "Title": tr("All"), "Name": "All" },
Expand Down Expand Up @@ -345,6 +348,7 @@ sub setMusicOptions(options)
{ "Title": tr("DATE_ADDED"), "Name": "DateCreated" },
{ "Title": tr("DATE_PLAYED"), "Name": "DatePlayed" },
{ "Title": tr("RELEASE_DATE"), "Name": "PremiereDate" },
{ "Title": tr("Random"), "Name": "Random" },
]
options.filter = [
{ "Title": tr("All"), "Name": "All" },
Expand Down
5 changes: 3 additions & 2 deletions components/ItemGrid/MovieLibraryView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ sub setMoviesOptions(options)
{ "Title": tr("OFFICIAL_RATING"), "Name": "OfficialRating" },
{ "Title": tr("PLAY_COUNT"), "Name": "PlayCount" },
{ "Title": tr("RELEASE_DATE"), "Name": "PremiereDate" },
{ "Title": tr("RUNTIME"), "Name": "Runtime" }
{ "Title": tr("RUNTIME"), "Name": "Runtime" },
{ "Title": tr("Random"), "Name": "Random" },
]

options.filter = [
Expand All @@ -272,7 +273,7 @@ sub setMoviesOptions(options)
if m.options.view = "Studios" or m.view = "Studios"
options.sort = [
{ "Title": tr("TITLE"), "Name": "SortName" },
{ "Title": tr("DATE_ADDED"), "Name": "DateCreated" },
{ "Title": tr("DATE_ADDED"), "Name": "DateCreated" }
]
options.filter = [
{ "Title": tr("All"), "Name": "All" },
Expand Down
3 changes: 3 additions & 0 deletions components/ItemGrid/MusicLibraryView.bs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ sub setMusicOptions(options)
{ "Title": tr("DATE_ADDED"), "Name": "DateCreated" },
{ "Title": tr("DATE_PLAYED"), "Name": "DatePlayed" },
{ "Title": tr("RELEASE_DATE"), "Name": "PremiereDate" },
{ "Title": tr("Random"), "Name": "Random" },
]

options.filter = [
Expand All @@ -238,6 +239,7 @@ sub setMusicOptions(options)
if LCase(m.options.view) = "genres" or LCase(m.view) = "genres"
options.sort = [
{ "Title": tr("TITLE"), "Name": "SortName" },
{ "Title": tr("Random"), "Name": "Random" },
]
options.filter = []
end if
Expand All @@ -246,6 +248,7 @@ sub setMusicOptions(options)
options.sort = [
{ "Title": tr("TITLE"), "Name": "SortName" },
{ "Title": tr("DATE_ADDED"), "Name": "DateCreated" },
{ "Title": tr("Random"), "Name": "Random" },
]
end if
end sub
Expand Down
5 changes: 5 additions & 0 deletions locale/en_US/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1246,5 +1246,10 @@
<translation>What's New?</translation>
<extracomment>Popup title - Popup displays all the major changes to the app since the last version</extracomment>
</message>
<message>
<source>Random</source>
<translation>Random</translation>
<extracomment>General use word when we want to randomize data</extracomment>
</message>
</context>
</TS>

0 comments on commit 7e3a234

Please sign in to comment.