Skip to content

Commit 1103b93

Browse files
authored
Merge pull request #431 from arabcoders/dev
Add experimental simple view mode
2 parents 8a852bc + fb22218 commit 1103b93

File tree

20 files changed

+1061
-243
lines changed

20 files changed

+1061
-243
lines changed

.github/workflows/main.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ jobs:
4747
python-version: ${{ env.PYTHON_VERSION }}
4848

4949
- name: Install uv
50-
uses: astral-sh/setup-uv@v4
50+
uses: astral-sh/setup-uv@v6.7
5151
with:
52+
enable-cache: true
53+
save-cache: true
5254
version: "latest"
5355

5456
- name: Install Python dependencies
@@ -160,7 +162,7 @@ jobs:
160162
echo "APP_SHA=${SHA}" >> "$GITHUB_ENV"
161163
echo "APP_DATE=${DATE}" >> "$GITHUB_ENV"
162164
echo "APP_BRANCH=${BRANCH}" >> "$GITHUB_ENV"
163-
165+
164166
sed -i \
165167
-e "s/^APP_VERSION = \".*\"/APP_VERSION = \"${VERSION}\"/" \
166168
-e "s/^APP_COMMIT_SHA = \".*\"/APP_COMMIT_SHA = \"${SHA}\"/" \

app/library/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class Config(metaclass=Singleton):
4545
temp_path: str = "/tmp"
4646
"""The path to the temporary directory."""
4747

48+
simple_mode: bool = False
49+
"""Enable simple mode."""
50+
4851
temp_keep: bool = False
4952
"""Keep temporary files after the download is complete."""
5053

@@ -244,6 +247,7 @@ class Config(metaclass=Singleton):
244247
"prevent_premiere_live",
245248
"temp_disabled",
246249
"allow_internal_urls",
250+
"simple_mode",
247251
)
248252
"The variables that are booleans."
249253

@@ -259,6 +263,7 @@ class Config(metaclass=Singleton):
259263
"default_preset",
260264
"instance_title",
261265
"console_enabled",
266+
"simple_mode",
262267
"browser_control_enabled",
263268
"file_logging",
264269
"base_path",

ui/app/assets/css/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,10 @@ div.is-centered {
358358
justify-content: center;
359359
}
360360

361+
.is-overflow-visible {
362+
overflow: visible !important
363+
}
364+
361365
.modal-content-max {
362366
width: calc(100% - 20px);
363367
max-width: 1344px;

ui/app/components/ConditionForm.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ import { useStorage } from '@vueuse/core'
268268
import TextareaAutocomplete from '~/components/TextareaAutocomplete.vue'
269269
import type { AutoCompleteOptions } from '~/types/autocomplete';
270270
import type { ConditionItem, ImportedConditionItem } from '~/types/conditions'
271+
import {useConfirm} from '~/composables/useConfirm'
271272
272273
const emitter = defineEmits<{
273274
(e: 'cancel'): void
@@ -410,7 +411,7 @@ const importItem = async (): Promise<void> => {
410411
return
411412
}
412413
413-
if ((form.filter || form.cli || Object.keys(form.extras).length > 0) && !(await box.confirm('Overwrite the current form fields?', true))) {
414+
if ((form.filter || form.cli || Object.keys(form.extras).length > 0) && !(await box.confirm('Overwrite the current form fields?'))) {
414415
return
415416
}
416417

ui/app/components/History.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,7 @@
450450
import moment from 'moment'
451451
import { useStorage } from '@vueuse/core'
452452
import type { StoreItem } from '~/types/store'
453+
import {useConfirm} from '~/composables/useConfirm'
453454
454455
const emitter = defineEmits<{
455456
(e: 'getInfo', url: string, preset: string, cli: string): void
@@ -588,7 +589,7 @@ const deleteSelectedItems = async () => {
588589
if (true === config.app.remove_files) {
589590
msg += ' This will remove any associated files if they exists.'
590591
}
591-
if (false === (await box.confirm(msg, config.app.remove_files))) {
592+
if (false === (await box.confirm(msg))) {
592593
return
593594
}
594595
for (const key in selectedElms.value) {
@@ -750,7 +751,7 @@ const removeItem = async (item: StoreItem) => {
750751
if (item.status === 'finished' && config.app.remove_files) {
751752
msg += ' This will remove any associated files if they exists.'
752753
}
753-
if (false === (await box.confirm(msg, Boolean(item.filename && config.app.remove_files)))) {
754+
if (false === (await box.confirm(msg))) {
754755
return false
755756
}
756757

ui/app/components/NotificationForm.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@
308308
<script setup lang="ts">
309309
import { useStorage } from '@vueuse/core'
310310
import type { notification, notificationImport } from '~/types/notification'
311+
import {useConfirm} from '~/composables/useConfirm'
311312
312313
const emitter = defineEmits(['cancel', 'submit'])
313314
const toast = useNotification()
@@ -412,7 +413,7 @@ const importItem = async () => {
412413
}
413414
414415
if (form.name || form.request?.url) {
415-
if (false === (await box.confirm('Overwrite the current form fields?', true))) {
416+
if (false === (await box.confirm('Overwrite the current form fields?'))) {
416417
return
417418
}
418419
}

ui/app/components/Queue.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@
313313
import moment from 'moment'
314314
import { useStorage } from '@vueuse/core'
315315
import type { StoreItem } from '~/types/store'
316+
import {useConfirm} from '~/composables/useConfirm'
316317
317318
const emitter = defineEmits<{
318319
(e: 'getInfo', url: string, preset: string, cli: string): void

ui/app/components/Settings.vue

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,25 @@
1212
<div class="columns is-multiline">
1313
<div class="column is-6">
1414

15+
<div class="field">
16+
<label class="label is-unselectable">
17+
<span class="icon"><i class="fa-solid fa-computer" /></span>
18+
Page View
19+
</label>
20+
<div class="control">
21+
<div class="control">
22+
<input id="random_bg" type="checkbox" class="switch is-success" v-model="simpleMode">
23+
<label for="random_bg" class="is-unselectable">
24+
&nbsp;{{ simpleMode ? 'Simple View (Experimental)' : 'Regular View (Default)' }}
25+
</label>
26+
</div>
27+
</div>
28+
<p class="help is-bold has-text-danger">
29+
<span class="icon"> <i class="fa-solid fa-info-circle" /></span>
30+
The simple view is experimental and will change without notice and maybe even deleted in the future.
31+
</p>
32+
</div>
33+
1534
<div class="field">
1635
<label class="label is-unselectable">Color scheme</label>
1736
<div class="control">
@@ -35,7 +54,7 @@
3554

3655
<div class="field">
3756
<label class="label is-unselectable">
38-
Backgrounds
57+
Show Background
3958
<template v-if="bg_enable">
4059
<NuxtLink @click="$emit('reload_bg')" class="is-bold">Reload</NuxtLink>
4160
<span class="icon" v-if="isLoading"><i class="fa fa-spin fa-spinner" /></span>
@@ -44,7 +63,7 @@
4463
<div class="control">
4564
<input id="random_bg" type="checkbox" class="switch is-success" v-model="bg_enable">
4665
<label for="random_bg" class="is-unselectable">
47-
&nbsp;{{ bg_enable ? 'Enabled' : 'Disabled' }}
66+
&nbsp;{{ bg_enable ? 'Yes' : 'No' }}
4867
</label>
4968
</div>
5069
</div>
@@ -59,17 +78,7 @@
5978
</div>
6079
</div>
6180

62-
<div class="field">
63-
<label class="label is-unselectable" for="show_thumbnail">Show Videos Thumbnail when possible</label>
64-
<div class="control">
65-
<input id="show_thumbnail" type="checkbox" class="switch is-success" v-model="show_thumbnail">
66-
<label for="show_thumbnail" class="is-unselectable">
67-
&nbsp;{{ show_thumbnail ? 'Enabled' : 'Disabled' }}
68-
</label>
69-
</div>
70-
</div>
71-
72-
<div class="field">
81+
<div class="field" v-if="!simpleMode">
7382
<label class="label is-unselectable" for="show_thumbnail">URLs Separator</label>
7483
<div class="control">
7584
<div class="select is-fullwidth">
@@ -85,27 +94,28 @@
8594
</div>
8695
<div class="column is-6">
8796
<div class="field">
88-
<label class="label is-unselectable" for="reduce_confirm">Reduce confirm box usage</label>
97+
<label class="label is-unselectable" for="show_thumbnail">Show Thumbnails</label>
8998
<div class="control">
90-
<input id="reduce_confirm" type="checkbox" class="switch is-success" v-model="reduce_confirm">
91-
<label for="reduce_confirm" class="is-unselectable">
92-
&nbsp;{{ reduce_confirm ? 'Enabled' : 'Disabled' }}
99+
<input id="show_thumbnail" type="checkbox" class="switch is-success" v-model="show_thumbnail">
100+
<label for="show_thumbnail" class="is-unselectable">
101+
&nbsp;{{ show_thumbnail ? 'Yes' : 'No' }}
93102
</label>
94103
</div>
104+
<p class="help is-bold"> Show videos thumbnail if available.</p>
95105
</div>
96106

97107
<div class="field">
98-
<label class="label" for="allow_toasts">Show notifications toasts</label>
108+
<label class="label" for="allow_toasts">Show notifications</label>
99109
<div class="control">
100110
<input id="allow_toasts" type="checkbox" class="switch is-success" v-model="allow_toasts">
101111
<label for="allow_toasts" class="is-unselectable">
102-
&nbsp;{{ allow_toasts ? 'Enabled' : 'Disabled' }}
112+
&nbsp;{{ allow_toasts ? 'Yes' : 'No' }}
103113
</label>
104114
</div>
105115
</div>
106116

107117
<div class="field" v-if="allow_toasts">
108-
<label class="label">Toasts position</label>
118+
<label class="label">Notification position</label>
109119
<div class="control">
110120
<div class="select is-fullwidth">
111121
<select v-model="toast_position">
@@ -121,12 +131,12 @@
121131
</div>
122132

123133
<div class="field" v-if="allow_toasts">
124-
<label class="label" for="dismiss_on_click">Dismiss toasts on click</label>
134+
<label class="label" for="dismiss_on_click">Dismiss notification on click</label>
125135
<div class="control">
126136
<input id="dismiss_on_click" type="checkbox" class="switch is-success"
127137
v-model="toast_dismiss_on_click">
128138
<label for="dismiss_on_click" class="is-unselectable">
129-
&nbsp;{{ toast_dismiss_on_click ? 'Enabled' : 'Disabled' }}
139+
&nbsp;{{ toast_dismiss_on_click ? 'Yes' : 'No' }}
130140
</label>
131141
</div>
132142
</div>
@@ -142,6 +152,7 @@
142152
<script setup lang="ts">
143153
import { useStorage } from '@vueuse/core'
144154
import { POSITION } from 'vue-toastification'
155+
import { useConfigStore } from '~/stores/ConfigStore'
145156
146157
defineProps<{ isLoading: boolean }>()
147158
defineEmits<{ (e: 'reload_bg'): void }>()
@@ -150,9 +161,9 @@ const bg_enable = useStorage<boolean>('random_bg', true)
150161
const bg_opacity = useStorage<number>('random_bg_opacity', 0.95)
151162
const selectedTheme = useStorage<'auto' | 'light' | 'dark'>('theme', 'auto')
152163
const allow_toasts = useStorage<boolean>('allow_toasts', true)
153-
const reduce_confirm = useStorage<boolean>('reduce_confirm', false)
154164
const toast_position = useStorage<POSITION>('toast_position', POSITION.TOP_RIGHT)
155165
const toast_dismiss_on_click = useStorage<boolean>('toast_dismiss_on_click', true)
156166
const show_thumbnail = useStorage<boolean>('show_thumbnail', true)
157167
const separator = useStorage<string>('url_separator', separators[0]?.value ?? ',')
168+
const simpleMode = useStorage<boolean>('simple_mode', useConfigStore().app.simple_mode || false)
158169
</script>

0 commit comments

Comments
 (0)