-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/fredrikburmester/streamyfin
- Loading branch information
Showing
6 changed files
with
115 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ build-* | |
*.mp4 | ||
build-* | ||
Streamyfin.app | ||
package-lock.json | ||
|
||
/ios | ||
/android | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,67 @@ | ||
import { | ||
ItemFilter, | ||
ItemSortBy, | ||
NameGuidPair, | ||
SortOrder, | ||
} from "@jellyfin/sdk/lib/generated-client/models"; | ||
import { atom, useAtom } from "jotai"; | ||
import { atom } from "jotai"; | ||
|
||
export enum SortByOption { | ||
Default = "Default", | ||
SortName = "SortName", | ||
CommunityRating = "CommunityRating", | ||
CriticRating = "CriticRating", | ||
DateCreated = "DateCreated", | ||
DatePlayed = "DatePlayed", | ||
PlayCount = "PlayCount", | ||
ProductionYear = "ProductionYear", | ||
Runtime = "Runtime", | ||
OfficialRating = "OfficialRating", | ||
PremiereDate = "PremiereDate", | ||
StartDate = "StartDate", | ||
IsUnplayed = "IsUnplayed", | ||
IsPlayed = "IsPlayed", | ||
AirTime = "AirTime", | ||
Studio = "Studio", | ||
IsFavoriteOrLiked = "IsFavoriteOrLiked", | ||
Random = "Random", | ||
} | ||
|
||
export enum SortOrderOption { | ||
Ascending = "Ascending", | ||
Descending = "Descending", | ||
} | ||
|
||
export const sortOptions: { | ||
key: ItemSortBy; | ||
key: SortByOption; | ||
value: string; | ||
}[] = [ | ||
{ key: "SortName", value: "Name" }, | ||
{ key: "CommunityRating", value: "Community Rating" }, | ||
{ key: "CriticRating", value: "Critics Rating" }, | ||
{ key: "DateCreated", value: "Date Added" }, | ||
// Only works for shows (last episode added) keeping for future ref. | ||
// { key: "DateLastContentAdded", value: "Content Added" }, | ||
{ key: "DatePlayed", value: "Date Played" }, | ||
{ key: "PlayCount", value: "Play Count" }, | ||
{ key: "ProductionYear", value: "Production Year" }, | ||
{ key: "Runtime", value: "Runtime" }, | ||
{ key: "OfficialRating", value: "Official Rating" }, | ||
{ key: "PremiereDate", value: "Premiere Date" }, | ||
{ key: "StartDate", value: "Start Date" }, | ||
{ key: "IsUnplayed", value: "Is Unplayed" }, | ||
{ key: "IsPlayed", value: "Is Played" }, | ||
// Broken in JF | ||
// { key: "VideoBitRate", value: "Video Bit Rate" }, | ||
{ key: "AirTime", value: "Air Time" }, | ||
{ key: "Studio", value: "Studio" }, | ||
{ key: "IsFavoriteOrLiked", value: "Is Favorite Or Liked" }, | ||
{ key: "Random", value: "Random" }, | ||
{ key: SortByOption.Default, value: "Default" }, | ||
{ key: SortByOption.SortName, value: "Name" }, | ||
{ key: SortByOption.CommunityRating, value: "Community Rating" }, | ||
{ key: SortByOption.CriticRating, value: "Critics Rating" }, | ||
{ key: SortByOption.DateCreated, value: "Date Added" }, | ||
{ key: SortByOption.DatePlayed, value: "Date Played" }, | ||
{ key: SortByOption.PlayCount, value: "Play Count" }, | ||
{ key: SortByOption.ProductionYear, value: "Production Year" }, | ||
{ key: SortByOption.Runtime, value: "Runtime" }, | ||
{ key: SortByOption.OfficialRating, value: "Official Rating" }, | ||
{ key: SortByOption.PremiereDate, value: "Premiere Date" }, | ||
{ key: SortByOption.StartDate, value: "Start Date" }, | ||
{ key: SortByOption.IsUnplayed, value: "Is Unplayed" }, | ||
{ key: SortByOption.IsPlayed, value: "Is Played" }, | ||
{ key: SortByOption.AirTime, value: "Air Time" }, | ||
{ key: SortByOption.Studio, value: "Studio" }, | ||
{ key: SortByOption.IsFavoriteOrLiked, value: "Is Favorite Or Liked" }, | ||
{ key: SortByOption.Random, value: "Random" }, | ||
]; | ||
|
||
export const sortOrderOptions: { | ||
key: SortOrder; | ||
key: SortOrderOption; | ||
value: string; | ||
}[] = [ | ||
{ key: "Ascending", value: "Ascending" }, | ||
{ key: "Descending", value: "Descending" }, | ||
{ key: SortOrderOption.Ascending, value: "Ascending" }, | ||
{ key: SortOrderOption.Descending, value: "Descending" }, | ||
]; | ||
|
||
export const genreFilterAtom = atom<string[]>([]); | ||
export const tagsFilterAtom = atom<string[]>([]); | ||
export const yearFilterAtom = atom<string[]>([]); | ||
export const sortByAtom = atom<[typeof sortOptions][number]>([sortOptions[0]]); | ||
export const sortOrderAtom = atom<[typeof sortOrderOptions][number]>([ | ||
sortOrderOptions[0], | ||
export const sortByAtom = atom<SortByOption[]>([SortByOption.Default]); | ||
export const sortOrderAtom = atom<SortOrderOption[]>([ | ||
SortOrderOption.Ascending, | ||
]); |