1- //! Guided yt-dlp/ffmpeg/quickjs install for tarball/dev builds (Flatpak Install is the only sandbox path).
1+ //! Guided yt-dlp/ffmpeg/Deno install for tarball/dev builds (Flatpak Install is the only sandbox path).
22
33use adw:: prelude:: * ;
44use gettextrs:: gettext;
@@ -7,6 +7,8 @@ use gtk4::glib;
77use gtk4:: prelude:: * ;
88use libadwaita as adw;
99
10+ const DENO_RELEASES_URL : & str = "https://github.com/denoland/deno/releases" ;
11+
1012/// Show the install-help dialog; `on_check` re-resolves tools and refreshes the caller.
1113pub fn show ( parent : & impl glib:: object:: IsA < gtk4:: Widget > , on_check : impl Fn ( ) + ' static ) {
1214 let dialog = adw:: AlertDialog :: new (
@@ -26,19 +28,16 @@ pub fn show(parent: &impl glib::object::IsA<gtk4::Widget>, on_check: impl Fn() +
2628 . title ( pkgs. distro . clone ( ) )
2729 . build ( ) ;
2830 command_row ( & group, & gettext ( "Install tools" ) , & pkgs. install_all ) ;
29- // No distro quickjs package: the command above installs only
30- // yt-dlp and ffmpeg, so link the upstream quickjs releases
31- // instead of dead-ending.
32- for ( tool, url) in extra_link_rows ( & pkgs) {
33- link_row ( & group, tool, url) ;
34- }
31+ // Deno is installed from the verified upstream release, not a
32+ // distro package; always show its official release page.
33+ link_row ( & group, "Deno" , DENO_RELEASES_URL ) ;
3534 content. append ( & group) ;
3635 }
3736 None => {
3837 let group = adw:: PreferencesGroup :: builder ( )
3938 . title ( gettext ( "Install the tools manually" ) )
4039 . description ( gettext (
41- "Install yt-dlp, ffmpeg, quickjs and gallery-dl yourself and make sure they are on your PATH." ,
40+ "Install yt-dlp, ffmpeg, Deno and gallery-dl yourself and make sure they are on your PATH." ,
4241 ) )
4342 . build ( ) ;
4443 link_row (
@@ -47,11 +46,7 @@ pub fn show(parent: &impl glib::object::IsA<gtk4::Widget>, on_check: impl Fn() +
4746 "https://github.com/yt-dlp/yt-dlp#installation" ,
4847 ) ;
4948 link_row ( & group, "ffmpeg" , "https://ffmpeg.org/download.html" ) ;
50- link_row (
51- & group,
52- "quickjs" ,
53- "https://github.com/quickjs-ng/quickjs/releases" ,
54- ) ;
49+ link_row ( & group, "Deno" , DENO_RELEASES_URL ) ;
5550 link_row (
5651 & group,
5752 "gallery-dl" ,
@@ -117,18 +112,6 @@ pub(crate) fn command_row(
117112 row
118113}
119114
120- /// Link rows the distro group needs beyond the install command: the upstream
121- /// quickjs releases when the distro has no quickjs package (the command then
122- /// covers only yt-dlp and ffmpeg). Pure so tests pin the dialog's rows
123- /// without needing a display.
124- fn extra_link_rows ( pkgs : & crate :: video_tools:: DistroPackages ) -> Vec < ( & ' static str , & ' static str ) > {
125- if pkgs. has_quickjs_package {
126- Vec :: new ( )
127- } else {
128- vec ! [ ( "quickjs" , "https://github.com/quickjs-ng/quickjs/releases" ) ]
129- }
130- }
131-
132115/// One outbound-link row for the manual fallback.
133116fn link_row ( group : & adw:: PreferencesGroup , tool : & str , url : & ' static str ) {
134117 let row = adw:: ActionRow :: builder ( ) . title ( tool) . build ( ) ;
@@ -147,29 +130,12 @@ fn link_row(group: &adw::PreferencesGroup, tool: &str, url: &'static str) {
147130#[ cfg( test) ]
148131mod tests {
149132 use super :: * ;
150- use crate :: video_tools:: DistroPackages ;
151-
152- fn pkgs ( has_quickjs_package : bool ) -> DistroPackages {
153- DistroPackages {
154- distro : "Void" . to_string ( ) ,
155- install_all : "sudo xbps-install -S yt-dlp ffmpeg" . to_string ( ) ,
156- has_quickjs_package,
157- }
158- }
159133
160134 #[ test]
161- fn quickjs_link_row_appears_without_distro_package ( ) {
162- // The dialog must not dead-end on distros without a quickjs package:
163- // the upstream releases link has to be among the group's rows.
135+ fn official_deno_release_link_is_stable_upstream ( ) {
164136 assert_eq ! (
165- extra_link_rows ( & pkgs ( false ) ) ,
166- vec! [ ( "quickjs" , " https://github.com/quickjs-ng/quickjs /releases") ]
137+ DENO_RELEASES_URL ,
138+ " https://github.com/denoland/deno /releases"
167139 ) ;
168140 }
169-
170- #[ test]
171- fn no_quickjs_link_row_with_distro_package ( ) {
172- // The install command already covers quickjs here; no extra row.
173- assert ! ( extra_link_rows( & pkgs( true ) ) . is_empty( ) ) ;
174- }
175141}
0 commit comments