From c5a4d5b6b7580b59a1f2f3e132d85e93e87af83f Mon Sep 17 00:00:00 2001 From: office-pc nix root Date: Sat, 5 Oct 2024 14:18:35 +0800 Subject: [PATCH] revamp video models to only have one instead of 3 --- lib/channels/models/channel.dart | 4 +- lib/channels/models/channel.g.dart | 2 +- lib/channels/models/channel_videos.dart | 8 +- lib/channels/models/channel_videos.g.dart | 2 +- lib/channels/views/components/info.dart | 17 +- lib/channels/views/components/videos.dart | 4 +- lib/channels/views/tv/screens/channel.dart | 77 +- lib/comments/states/comments.dart | 6 +- lib/comments/states/comments.freezed.dart | 31 +- lib/comments/views/components/comment.dart | 4 +- lib/comments/views/components/comments.dart | 5 +- lib/downloads/models/downloaded_video.dart | 56 +- .../models/downloaded_video.freezed.dart | 349 +++++ lib/downloads/models/downloaded_video.g.dart | 14 +- lib/downloads/states/download_manager.dart | 19 +- .../states/downloaded_video.freezed.dart | 19 + lib/home/models/db/home_layout.dart | 7 +- lib/player/states/audio_player.dart | 10 +- lib/player/states/audio_player.freezed.dart | 36 + lib/player/states/player.dart | 48 +- lib/player/states/player.freezed.dart | 57 +- .../states/player_controls.freezed.dart | 6 +- lib/player/states/tv_player_controls.dart | 4 +- lib/player/states/video_player.dart | 19 +- lib/player/states/video_player.freezed.dart | 36 + lib/player/views/components/video_queue.dart | 5 +- .../views/tv/components/player_controls.dart | 20 +- .../views/tv/screens/tv_player_view.dart | 4 +- lib/playlists/models/playlist.dart | 36 +- lib/playlists/models/playlist.freezed.dart | 476 +++++++ lib/playlists/models/playlist.g.dart | 242 +--- lib/playlists/states/playlist.dart | 10 +- lib/playlists/states/playlist.freezed.dart | 15 + .../views/components/playlist_inner_view.dart | 5 +- .../views/components/playlist_thumbnail.dart | 4 +- lib/playlists/views/screens/playlist.dart | 4 +- .../views/tablet/playlist_inner_view.dart | 7 +- lib/playlists/views/tv/screens/playlist.dart | 4 +- lib/router.dart | 2 - lib/router.gr.dart | 8 +- lib/search/models/search_results.dart | 5 +- lib/search/states/search.dart | 4 +- lib/search/views/screens/video_tab.dart | 4 +- lib/search/views/tv/screens/search.dart | 4 +- lib/service.dart | 42 +- lib/settings/models/db/video_filter.dart | 27 +- lib/utils.dart | 4 +- lib/utils/models/image_object.dart | 10 +- lib/utils/models/paginated_list.dart | 12 +- lib/utils/sembast_sqflite_database.dart | 2 +- lib/utils/video_post_processing.dart | 6 +- .../views/components/text_linkified.dart | 4 +- .../components/tv_horizontal_item_list.dart | 15 +- .../tv_horizontal_paginated_list.dart | 6 +- lib/videos/models/base_video.dart | 90 -- lib/videos/models/base_video.g.dart | 181 --- lib/videos/models/db/history_video_cache.dart | 13 +- lib/videos/models/dearrow.dart | 26 +- lib/videos/models/ided_video.dart | 3 + lib/videos/models/recommended_video.dart | 26 - lib/videos/models/recommended_video.g.dart | 33 - lib/videos/models/user_feed.dart | 7 +- lib/videos/models/user_feed.g.dart | 4 +- lib/videos/models/video.dart | 120 +- lib/videos/models/video.freezed.dart | 1186 +++++++++++++++++ lib/videos/models/video.g.dart | 135 +- lib/videos/models/video_in_list.dart | 51 - lib/videos/models/video_in_list.g.dart | 217 --- lib/videos/states/add_to_playlist.dart | 6 +- lib/videos/states/compact_video.freezed.dart | 19 + lib/videos/states/download_modal_sheet.dart | 7 +- lib/videos/states/video.dart | 3 +- lib/videos/states/video.freezed.dart | 36 + lib/videos/states/video_in_list.dart | 4 +- lib/videos/states/video_in_list.freezed.dart | 52 +- .../views/components/add_to_queue_button.dart | 6 +- .../views/components/compact_video.dart | 4 +- .../components/download_modal_sheet.dart | 6 +- .../views/components/history_video.dart | 2 +- lib/videos/views/components/info.dart | 20 +- lib/videos/views/components/popular.dart | 4 +- .../views/components/recommended_videos.dart | 9 +- .../views/components/subscriptions.dart | 4 +- lib/videos/views/components/trending.dart | 4 +- .../views/components/video_in_list.dart | 8 +- lib/videos/views/components/video_list.dart | 16 +- .../views/components/video_metrics.dart | 2 +- .../views/components/video_modal_sheet.dart | 6 +- .../views/components/video_share_button.dart | 4 +- .../views/tv/components/video_item.dart | 58 +- lib/videos/views/tv/screens/video.dart | 33 +- .../views/tv/screens/video_grid_view.dart | 10 +- lib/workmanager.dart | 4 +- 93 files changed, 2903 insertions(+), 1343 deletions(-) create mode 100644 lib/downloads/models/downloaded_video.freezed.dart create mode 100644 lib/playlists/models/playlist.freezed.dart delete mode 100644 lib/videos/models/base_video.dart delete mode 100644 lib/videos/models/base_video.g.dart create mode 100644 lib/videos/models/ided_video.dart delete mode 100644 lib/videos/models/recommended_video.dart delete mode 100644 lib/videos/models/recommended_video.g.dart create mode 100644 lib/videos/models/video.freezed.dart delete mode 100644 lib/videos/models/video_in_list.dart delete mode 100644 lib/videos/models/video_in_list.g.dart diff --git a/lib/channels/models/channel.dart b/lib/channels/models/channel.dart index a704e5f8..515d1c14 100644 --- a/lib/channels/models/channel.dart +++ b/lib/channels/models/channel.dart @@ -1,6 +1,6 @@ import 'package:clipious/settings/models/db/server.dart'; import 'package:clipious/utils/models/sharelink.dart'; -import 'package:clipious/videos/models/video_in_list.dart'; +import 'package:clipious/videos/models/video.dart'; import 'package:json_annotation/json_annotation.dart'; import '../../utils/models/image_object.dart'; @@ -22,7 +22,7 @@ class Channel implements ShareLinks { String description; List? allowedRegions; - List? latestVideos; + List