diff --git a/backend/video/src/constants.py b/backend/video/src/constants.py index 11b7de74..12fc4b23 100644 --- a/backend/video/src/constants.py +++ b/backend/video/src/constants.py @@ -31,8 +31,6 @@ class SortEnum(enum.Enum): LIKES = "stats.like_count" DURATION = "player.duration" MEDIASIZE = "media_size" - WIDTH = "streams.width" - HEIGHT = "streams.height" @classmethod def values(cls) -> list[str]: diff --git a/frontend/src/api/actions/updateUserConfig.ts b/frontend/src/api/actions/updateUserConfig.ts index 4557f287..84c5ce3d 100644 --- a/frontend/src/api/actions/updateUserConfig.ts +++ b/frontend/src/api/actions/updateUserConfig.ts @@ -1,6 +1,5 @@ -import { ViewLayoutType } from '../../pages/Home'; +import { SortByType, SortOrderType, ViewLayoutType } from '../../pages/Home'; import APIClient from '../../functions/APIClient'; -import { SortByType, SortOrderType } from '../loader/loadVideoListByPage'; export type ColourVariants = | 'dark.css' diff --git a/frontend/src/api/loader/loadVideoListByPage.ts b/frontend/src/api/loader/loadVideoListByPage.ts index b598df87..06066f77 100644 --- a/frontend/src/api/loader/loadVideoListByPage.ts +++ b/frontend/src/api/loader/loadVideoListByPage.ts @@ -1,4 +1,4 @@ -import { ConfigType, VideoType } from '../../pages/Home'; +import { ConfigType, SortByType, SortOrderType, VideoType } from '../../pages/Home'; import { PaginationType } from '../../components/Pagination'; import APIClient from '../../functions/APIClient'; @@ -8,45 +8,9 @@ export type VideoListByFilterResponseType = { paginate?: PaginationType; }; -export type SortByType = - | 'published' - | 'downloaded' - | 'views' - | 'likes' - | 'duration' - | 'mediasize' - | 'width' - | 'height'; -export const SortByEnum = { - Published: 'published', - Downloaded: 'downloaded', - Views: 'views', - Likes: 'likes', - Duration: 'duration', - 'Media Size': 'mediasize', -}; - -export const SortByExpandedEnum = { - ...SortByEnum, - Width: 'width', - Height: 'height', -}; - -export type SortOrderType = 'asc' | 'desc'; -export const SortOrderEnum = { - Asc: 'asc', - Desc: 'desc', -}; - +type WatchTypes = 'watched' | 'unwatched' | 'continue'; export type VideoTypes = 'videos' | 'streams' | 'shorts'; -export type WatchTypes = 'watched' | 'unwatched' | 'continue'; -export const WatchTypesEnum = { - Watched: 'watched', - Unwatched: 'unwatched', - Continue: 'continue', -}; - type FilterType = { page?: number; playlist?: string; diff --git a/frontend/src/components/Filterbar.tsx b/frontend/src/components/Filterbar.tsx index 32a91b1d..57394b19 100644 --- a/frontend/src/components/Filterbar.tsx +++ b/frontend/src/components/Filterbar.tsx @@ -4,15 +4,10 @@ import iconAdd from '/img/icon-add.svg'; import iconSubstract from '/img/icon-substract.svg'; import iconGridView from '/img/icon-gridview.svg'; import iconListView from '/img/icon-listview.svg'; +import { SortByType, SortOrderType } from '../pages/Home'; import { useUserConfigStore } from '../stores/UserConfigStore'; import { ViewStyles } from '../configuration/constants/ViewStyle'; import updateUserConfig, { UserConfigType } from '../api/actions/updateUserConfig'; -import { - SortByEnum, - SortByType, - SortOrderEnum, - SortOrderType, -} from '../api/loader/loadVideoListByPage'; type FilterbarProps = { hideToggleText: string; @@ -72,9 +67,12 @@ const Filterbar = ({ hideToggleText, viewStyleName, showSort = true }: Filterbar handleUserConfigUpdate({ sort_by: event.target.value as SortByType }); }} > - {Object.entries(SortByEnum).map(([key, value]) => { - return ; - })} + + + + + + diff --git a/frontend/src/components/SettingsNavigation.tsx b/frontend/src/components/SettingsNavigation.tsx index 970f16b7..5475614b 100644 --- a/frontend/src/components/SettingsNavigation.tsx +++ b/frontend/src/components/SettingsNavigation.tsx @@ -26,9 +26,6 @@ const SettingsNavigation = () => {
- Show watched:{' '}
-
-
- Sort by:
-
-
-
No videos found
} - - {hasVideos && ( -| - {channel.channel_name} - | -- {title} - | -{vid_type} | -{videoStream.width} | -{videoStream.height} | -{humanFileSize(media_size, useSiUnits)} | -{videoStream.codec} | -{humanFileSize(videoStream.bitrate, useSiUnits)} | -{audioStream.codec} | -{humanFileSize(audioStream.bitrate, useSiUnits)} | -
| Channel name | -Video title | -Type | -
- {
- onHeaderClicked('width');
- }}
- >
-
-
-
- |
-
- {
- onHeaderClicked('height');
- }}
- >
- |
-
- {
- onHeaderClicked('mediasize');
- }}
- >
- |
- Video codec | -Video bitrate | -Audio codec | -Audio bitrate | -
|---|