add per playlist page size
This commit is contained in:
parent
dfd86f8a80
commit
ce19693a86
|
|
@ -24,6 +24,7 @@ class AppConfigSubSerializer(
|
|||
channel_size = serializers.IntegerField(required=False)
|
||||
live_channel_size = serializers.IntegerField(required=False)
|
||||
shorts_channel_size = serializers.IntegerField(required=False)
|
||||
playlist_size = serializers.IntegerField(required=False)
|
||||
auto_start = serializers.BooleanField(required=False)
|
||||
extract_flat = serializers.BooleanField(required=False)
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ class SubscriptionsConfigType(TypedDict):
|
|||
channel_size: int
|
||||
live_channel_size: int
|
||||
shorts_channel_size: int
|
||||
playlist_size: int
|
||||
auto_start: bool
|
||||
extract_flat: bool
|
||||
|
||||
|
|
@ -73,6 +74,7 @@ class AppConfig:
|
|||
"channel_size": 50,
|
||||
"live_channel_size": 50,
|
||||
"shorts_channel_size": 50,
|
||||
"playlist_size": 50,
|
||||
"auto_start": False,
|
||||
"extract_flat": False,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class PlaylistSubscription:
|
|||
if not all_playlists:
|
||||
return 0
|
||||
|
||||
size_limit = self.config["subscriptions"]["channel_size"]
|
||||
size_limit = self.config["subscriptions"]["playlist_size"]
|
||||
all_playlist_urls: list[ParsedURLType] = []
|
||||
for playlist in all_playlists:
|
||||
all_playlist_urls.append(
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ export type AppSettingsConfigType = {
|
|||
channel_size: number | null;
|
||||
live_channel_size: number | null;
|
||||
shorts_channel_size: number | null;
|
||||
playlist_size: number | null;
|
||||
auto_start: boolean;
|
||||
extract_flat: boolean;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ const SettingsApplication = () => {
|
|||
const [videoPageSize, setVideoPageSize] = useState<number | null>(null);
|
||||
const [livePageSize, setLivePageSize] = useState<number | null>(null);
|
||||
const [shortPageSize, setShortPageSize] = useState<number | null>(null);
|
||||
const [playlistPageSize, setPlaylistPageSize] = useState<number | null>(null);
|
||||
const [isAutostart, setIsAutostart] = useState<boolean>(false);
|
||||
const [isExtractFlat, setIsExtractFlat] = useState<boolean>(false);
|
||||
|
||||
|
|
@ -98,6 +99,7 @@ const SettingsApplication = () => {
|
|||
setVideoPageSize(appSettingsConfigData?.subscriptions.channel_size || null);
|
||||
setLivePageSize(appSettingsConfigData?.subscriptions.live_channel_size || null);
|
||||
setShortPageSize(appSettingsConfigData?.subscriptions.shorts_channel_size || null);
|
||||
setPlaylistPageSize(appSettingsConfigData?.subscriptions.playlist_size || null);
|
||||
setIsAutostart(appSettingsConfigData?.subscriptions.auto_start || false);
|
||||
setIsExtractFlat(appSettingsConfigData?.subscriptions.extract_flat || false);
|
||||
|
||||
|
|
@ -260,6 +262,19 @@ const SettingsApplication = () => {
|
|||
updateCallback={handleUpdateConfig}
|
||||
/>
|
||||
</div>
|
||||
<div className="settings-box-wrapper">
|
||||
<div>
|
||||
<p>Playlist page size</p>
|
||||
</div>
|
||||
<InputConfig
|
||||
type="number"
|
||||
name="subscriptions.playlist_size"
|
||||
value={playlistPageSize}
|
||||
setValue={setPlaylistPageSize}
|
||||
oldValue={appSettingsConfig?.subscriptions.playlist_size}
|
||||
updateCallback={handleUpdateConfig}
|
||||
/>
|
||||
</div>
|
||||
<div className="settings-box-wrapper">
|
||||
<div>
|
||||
<p>Autostart download subscriptions</p>
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ export const useAppSettingsStore = create<AppSettingsState>(set => ({
|
|||
channel_size: null,
|
||||
live_channel_size: null,
|
||||
shorts_channel_size: null,
|
||||
playlist_size: null,
|
||||
auto_start: false,
|
||||
extract_flat: false,
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue