25
25
v-model =" dialog.appendToPlaylist"
26
26
></ion-checkbox >
27
27
</ion-item >
28
+ <ion-item lines =" full" >
29
+ <ion-label >Youtube quality</ion-label >
30
+ <ion-select v-model =" dialog['file-local-options']['ytdl-format']" >
31
+ <ion-select-option value =" " >Default</ion-select-option >
32
+ <ion-select-option value =" bestvideo[height<=?2160]+bestaudio/best"
33
+ >4k</ion-select-option
34
+ >
35
+ <ion-select-option value =" bestvideo[height<=?1440]+bestaudio/best"
36
+ >1440p</ion-select-option
37
+ >
38
+ <ion-select-option value =" bestvideo[height<=?1080]+bestaudio/best"
39
+ >1080p</ion-select-option
40
+ >
41
+ <ion-select-option value =" bestvideo[height<=?720]+bestaudio/best"
42
+ >720p</ion-select-option
43
+ >
44
+ <ion-select-option value =" bestvideo[height<=?480]+bestaudio/best"
45
+ >480p</ion-select-option
46
+ >
47
+ </ion-select >
48
+ </ion-item >
28
49
<ion-button
29
50
expand =" block"
30
51
style =" margin-top : 10px "
@@ -50,20 +71,36 @@ import {
50
71
IonLabel ,
51
72
IonButton ,
52
73
IonButtons ,
74
+ IonSelect ,
75
+ IonSelectOption ,
53
76
} from " @ionic/vue" ;
54
77
import { arrowBack } from " ionicons/icons" ;
78
+ import { loadFileFlags } from " ../tools" ;
79
+
55
80
export default {
56
81
props: [" modalController" ],
57
82
setup (props ) {
58
83
const dialog = ref ({
59
84
filename: " " ,
60
85
appendToPlaylist: true ,
61
86
" file-local-options" : {
62
- " ytdl-format" : " bestvideo[height<=?720]+bestaudio/best " ,
87
+ " ytdl-format" : " " ,
63
88
},
64
89
});
90
+
65
91
const onAppendClicked = () => {
66
- props .modalController .dismiss (dialog);
92
+ if (dialog .value .appendToPlaylist ) {
93
+ dialog .value .flag = loadFileFlags .APPEND_PLAY ;
94
+ } else {
95
+ dialog .value .flag = loadFileFlags .REPLACE ;
96
+ }
97
+
98
+ delete dialog .value .appendToPlaylist ;
99
+ // if (dialog.value["file-local-options"]["ytdl-format"].length === 0) {
100
+ // delete dialog.value["file-local-options"]["ytdl-format"];
101
+ // }
102
+
103
+ props .modalController .dismiss (dialog .value );
67
104
};
68
105
69
106
const onCancelClicked = () => {
@@ -88,6 +125,8 @@ export default {
88
125
IonItem,
89
126
IonButton,
90
127
IonButtons,
128
+ IonSelect,
129
+ IonSelectOption,
91
130
},
92
131
};
93
132
</script >
0 commit comments