diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml index 3109b0e9..c2baa003 100644 --- a/.github/workflows/build_linux.yml +++ b/.github/workflows/build_linux.yml @@ -1,24 +1,22 @@ name: Linux CI on: workflow_dispatch: - push: - branches: - - "main" - paths-ignore: - - "docs/**" - - "**/.gitignore" - - "**/.dockerignore" - - LICENSE - - "**/*.md" - pull_request: - branches: - - "main" - paths-ignore: - - "docs/**" - - "**/.gitignore" - - "**/.dockerignore" - - LICENSE - - "**/*.md" + # push: + # branches: + # - "dev" + # paths-ignore: + # - "docs/**" + # - ".gitignore" + # - LICENSE + # - "*.md" + # pull_request: + # branches: + # - "dev" + # paths-ignore: + # - "docs/**" + # - ".gitignore" + # - LICENSE + # - "*.md" jobs: build: diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index ddbf97b2..68d0d046 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -1,8 +1,14 @@ name: CI Passing on: - push: - tags: - - v* + workflow_dispatch: + # push: + # branches: + # - "dev" + # paths-ignore: + # - "docs/**" + # - "*.md" + # - LICENSE + # - .gitignore env: CARGO_TERM_COLOR: always @@ -23,7 +29,7 @@ jobs: os: ubuntu-latest target: arm64 # x86_64-windows-gnu - - arch: x86_64-windows-gnu + - arch: ucrt-x86_64-windows-gnu os: windows-latest target: amd64 @@ -189,7 +195,7 @@ jobs: - name: Get latest tag name id: tag - run: echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT + run: echo "TAG_NAME=v$(date '+%Y-%m-%d-%H%M%S')" >> $GITHUB_OUTPUT - name: Set prerelease variable if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '-alpha') diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index fc4e5ce0..0443238f 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -3,22 +3,20 @@ on: workflow_dispatch: push: branches: - - "main" + - "dev" paths-ignore: - "docs/**" - - "**/.gitignore" - - "**/.dockerignore" + - ".gitignore" - LICENSE - - "**/*.md" - pull_request: - branches: - - "main" - paths-ignore: - - "docs/**" - - "**/.gitignore" - - "**/.dockerignore" - - LICENSE - - "**/*.md" + - "*.md" + # pull_request: + # branches: + # - "dev" + # paths-ignore: + # - "docs/**" + # - ".gitignore" + # - LICENSE + # - "*.md" env: CARGO_TERM_COLOR: always @@ -38,7 +36,6 @@ jobs: # env: x86_64 - arch: ucrt64-x86_64-windows-gnu os: windows-latest - target: x86_64-pc-windows-gnu msystem: ucrt64 env: ucrt-x86_64 @@ -72,7 +69,7 @@ jobs: mingw-w64-${{ matrix.env }}-gst-libav curl - - name: Build tsukimi-${{ matrix.target }} + - name: Build tsukimi-${{ matrix.arch }} if: ${{ !startsWith(github.ref, 'refs/tags/') }} shell: msys2 {0} run: | @@ -151,10 +148,10 @@ jobs: if: ${{ !startsWith(github.ref, 'refs/tags/') }} uses: actions/upload-artifact@v4 with: - name: tsukimi-${{matrix.target}} + name: tsukimi-${{matrix.arch}} path: | - artifact/*.exe artifact/*.7z + artifact/*.exe artifact/*.sha512sum compression-level: 0 retention-days: 3 diff --git a/.gitignore b/.gitignore index 3b42f00d..59a1e75a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /i18n /.idea /backup +/.cargo diff --git a/Cargo.toml b/Cargo.toml index c1ba708c..758da9e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,13 +12,17 @@ gtk = { version = "0.9", package = "gtk4", features = ["v4_16"] } serde = { version = "1.0.214", features = ["derive"] } serde_json = "1.0.132" tokio = { version = "1.41", features = ["full"] } -reqwest = { version = "0.12", default-features = false, features = ["http2", "native-tls", "native-tls-alpn", "json", "gzip"] } +reqwest = { version = "0.12", default-features = false, features = [ + "http2", + "native-tls", + "native-tls-alpn", + "json", + "gzip", +] } async-channel = "2.3.1" once_cell = "1.20.2" dirs = "5.0.1" -adw = { version = "0.7", package = "libadwaita", features = [ - "v1_6", -] } +adw = { version = "0.7", package = "libadwaita", features = ["v1_6"] } cargo-deb = "2.7.0" bytefmt = "0.1.7" libc = "0.2.159" @@ -38,13 +42,19 @@ atomic-wait = "1.1.0" flume = "0.11.1" derive_builder = "0.20.2" anyhow = "1.0.91" -windows = { version = "0.58.0", features = ["Win32_Foundation", "Win32_Networking_WinHttp", "Win32_System_Power", "Win32_System_Registry", "Win32_UI_WindowsAndMessaging"] } -tracing-subscriber = { version="0.3.18", features = ["chrono"] } +windows = { version = "0.58.0", features = [ + "Win32_Foundation", + "Win32_Networking_WinHttp", + "Win32_System_Power", + "Win32_System_Registry", + "Win32_UI_WindowsAndMessaging", +] } +tracing-subscriber = { version = "0.3.18", features = ["chrono"] } gdk4-x11 = { version = "0.9", optional = true } gdk4-win32 = { version = "0.9", optional = true } regex = "1.11.1" strsim = "0.11.1" -clap = { version="4.5.20", features = ["derive"] } +clap = { version = "4.5.20", features = ["derive"] } fnv = "1.0.7" md-5 = "0.10.6" unicode-segmentation = "1.12.0" @@ -56,12 +66,11 @@ embed-resource = "2.5.0" glib-build-tools = "0.20.0" [features] -console = [] # Enable console logging +console = [] # Enable console logging default = ["protocols", "render"] -protocols = [] # Enable custom protocol callbacks -render = [] # Enable custom rendering -build_libmpv = [ -] # build libmpv automatically, provided MPV_SOURCE is set +protocols = [] # Enable custom protocol callbacks +render = [] # Enable custom rendering +build_libmpv = [] # build libmpv automatically, provided MPV_SOURCE is set x11 = ["gdk4-x11"] win32 = ["gdk4-win32"] @@ -82,20 +91,23 @@ depends = "$auto" section = "utility" priority = "optional" assets = [ - [ - "target/release/tsukimi", - "usr/bin/", - "755", - ], - [ - "README.md", - "usr/share/doc/tsukimi/README", - "644", - ], + [ + "target/release/tsukimi", + "usr/bin/", + "755", + ], + [ + "README.md", + "usr/share/doc/tsukimi/README", + "644", + ], ] [profile.release] lto = true +codegen-units = 1 +opt-level = "s" +strip = true [profile.dev] debug = true diff --git a/src/arg.rs b/src/arg.rs index c42d5f0f..9974e98a 100644 --- a/src/arg.rs +++ b/src/arg.rs @@ -14,7 +14,7 @@ use tracing_subscriber::fmt::time::ChronoLocal; use crate::dyn_event; -const DEFAULT_RENDERER: &str = "gl"; +const DEFAULT_RENDERER: &str = "ngl"; #[derive(Parser, Debug)] #[command(version, about, long_about = None)] @@ -42,6 +42,27 @@ pub struct Args { gdk_scale: Option, } +struct Envs { + log_level: LevelFilter, + log_file: Option, +} + +impl Envs { + fn load() -> Self { + Self { + log_level: match std::env::var("TSUKIMI_LOG_LEVEL").as_deref() { + Ok("ERROR") => LevelFilter::ERROR, + Ok("WARN") => LevelFilter::WARN, + Ok("INFO") => LevelFilter::INFO, + Ok("DEBUG") => LevelFilter::DEBUG, + Ok("TRACE") => LevelFilter::TRACE, + _ => LevelFilter::INFO, + }, + log_file: std::env::var("TSUKIMI_LOG_FILE").ok(), + } + } +} + impl Args { /// Build the tracing subscriber using parameters from the command line /// arguments @@ -58,11 +79,20 @@ impl Args { Some("info") => builder.with_max_level(LevelFilter::INFO), Some("debug") => builder.with_max_level(LevelFilter::DEBUG), Some("trace") => builder.with_max_level(LevelFilter::TRACE), - _ => builder.with_max_level(LevelFilter::INFO), + _ => builder.with_max_level(Envs::load().log_level), }; match &self.log_file { - None => builder.with_writer(io::stderr).init(), + None => { + if let Some(f) = Envs::load().log_file { + builder + .with_ansi(false) + .with_writer(Mutex::new(File::create(f).unwrap())) + .init() + } else { + builder.with_writer(io::stderr).init() + } + } Some(f) => { let tracing_writer = match File::create(f) { Ok(f) => f, diff --git a/src/client/client.rs b/src/client/client.rs index dd0d6663..78d3936d 100644 --- a/src/client/client.rs +++ b/src/client/client.rs @@ -25,7 +25,9 @@ use serde_json::{ Value, }; use tracing::{ - debug, info, warn + debug, + info, + warn, }; use url::Url; use uuid::Uuid; diff --git a/src/client/structs.rs b/src/client/structs.rs index 8e4806a4..b43edeec 100644 --- a/src/client/structs.rs +++ b/src/client/structs.rs @@ -169,12 +169,13 @@ impl Default for IdType { } } -impl ToString for IdType { - fn to_string(&self) -> String { - return match self { +impl std::fmt::Display for IdType { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + let str = match self { IdType::String(s) => s.to_string(), - IdType::Int(i) => i.to_string() - } + IdType::Int(i) => i.to_string(), + }; + write!(f, "{}", str) } } diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 575d052d..9032af4e 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -57,7 +57,7 @@ pub fn load_css() { border-radius: 999px; margin: 3px; }} - + box>overlay>image {{ background-color: {}; border-radius: 999px; @@ -70,6 +70,9 @@ pub fn load_css() { accent_color )); + #[cfg(target_os = "windows")] + styles.push_str("window {box-shadow: 0px 0px 5px 0px rgba(5, 5, 5, 0.4);}"); + provider.load_from_string(&styles); gtk::style_context_add_provider_for_display( diff --git a/src/ui/mpv/mpvglarea.rs b/src/ui/mpv/mpvglarea.rs index f95204d7..51dcfb39 100644 --- a/src/ui/mpv/mpvglarea.rs +++ b/src/ui/mpv/mpvglarea.rs @@ -56,7 +56,7 @@ mod imp { } fn dispose(&self) { - if let Some(mpv) = self.mpv.mpv.lock().ok() { + if let Ok(mpv) = self.mpv.mpv.lock() { drop(mpv); } } diff --git a/src/ui/mpv/tsukimi_mpv.rs b/src/ui/mpv/tsukimi_mpv.rs index d0379cf3..a533c5e6 100644 --- a/src/ui/mpv/tsukimi_mpv.rs +++ b/src/ui/mpv/tsukimi_mpv.rs @@ -573,6 +573,7 @@ const KEYSTRING_MAP: &[(&str, &str)] = &[ ("", "Shift_R"), ("", "grave"), ("SPACE", " "), + ("TAB", "\t"), ]; fn keyval_to_keystr(keyval: u32) -> Option { diff --git a/src/ui/provider/tu_item.rs b/src/ui/provider/tu_item.rs index db9cc593..27c5bba9 100644 --- a/src/ui/provider/tu_item.rs +++ b/src/ui/provider/tu_item.rs @@ -19,10 +19,10 @@ use crate::{ }, toast, ui::widgets::{ - other::OtherPage, item::ItemPage, list::ListPage, music_album::AlbumPage, + other::OtherPage, single_grid::SingleGrid, window::Window, }, @@ -331,7 +331,7 @@ impl TuItem { _ => { let page = OtherPage::new(self); push_page_with_tag(window, page, self.name()); - }, + } } } diff --git a/src/ui/style.css b/src/ui/style.css index 89741f2c..8c4d1db1 100644 --- a/src/ui/style.css +++ b/src/ui/style.css @@ -66,7 +66,7 @@ child { border-radius: 10px; } -.tu-listview>row { +.tu-listview > row { margin: 10px; border-radius: 10px; } @@ -81,7 +81,8 @@ button.star:hover { -gtk-icon-transform: rotate(-72deg); } - to {} + to { + } } @keyframes rotate_unstar { @@ -89,7 +90,8 @@ button.star:hover { -gtk-icon-transform: rotate(72deg); } - to {} + to { + } } button.star.interacted.starred image { @@ -113,13 +115,13 @@ button.star.interacted:not(.starred) image { border-radius: 10px; } -.horizontal-listview>row { +.horizontal-listview > row { margin-left: 9px; margin-right: 9px; border-radius: 10px; } -.vertical-listview>row { +.vertical-listview > row { margin: 9px; border-radius: 10px; } @@ -136,41 +138,41 @@ gridview { background-color: rgba(0, 0, 0, 0); } -gridview>child box { +gridview > child box { margin: 0px; } -overlay>label { +overlay > label { background-color: #aeb5fa; border-radius: 50px; margin: 3px; } -box>overlay>image { +box > overlay > image { background-color: #aeb5fa; border-radius: 50px; margin: 3px; } -revealer>box>box>widget { +revealer > box > box > widget { background-color: rgba(1, 1, 1, 0.1); border-radius: 10px; } -revealer>box>box>widget>box { +revealer > box > box > widget > box { margin: 10px; } -tabbar>revealer>box { +tabbar > revealer > box { background-color: rgba(0, 0, 0, 0); } -scrolledwindow>viewport>box>box>box { +scrolledwindow > viewport > box > box > box { margin-left: 15px; margin-top: 15px; } -.osd>box { +.osd > box { margin: 0px; padding: 0px; border-radius: 10px; @@ -199,4 +201,67 @@ row.expand.interacted.expanded image { row image { transition: 200ms cubic-bezier(0.25, 0.46, 0.45, 0.94); -} \ No newline at end of file +} + +/* Scale UI Font to 125% */ +* { + -gtk-dpi: 125; +} + +/* GTK4 Window Controls Styles */ +windowcontrols > button { + color: transparent; + min-width: 20px; + min-height: 20px; + padding: 0; + margin: 0 2px; + border: none; + border-radius: 50%; + transition: all 0.2s ease; +} + +windowcontrols > button > image { + padding: 0; + -gtk-icon-size: 14px; + color: rgba(0, 0, 0, 0.7); + opacity: 0; + transition: opacity 0.2s ease, color 0.2s ease; +} + +/* Button colors */ +button.titlebutton.close, +windowcontrols > button.close { + background-color: #ff5f56; +} + +button.titlebutton.maximize, +windowcontrols > button.maximize { + background-color: #ffbd2e; +} + +button.titlebutton.minimize, +windowcontrols > button.minimize { + background-color: #27c93f; +} + +/* Hover states */ +windowcontrols > button:hover { + background-color: rgba(0, 0, 0, 0.1); +} + +windowcontrols > button:hover > image { + opacity: 1; + color: rgba(0, 0, 0, 0.9); +} + +windowcontrols > button.close:hover { + background-color: #ff5f56; +} + +windowcontrols > button.maximize:hover { + background-color: #ffbd2e; +} + +windowcontrols > button.minimize:hover { + background-color: #27c93f; +} diff --git a/src/ui/widgets/horbu_scrolled.rs b/src/ui/widgets/horbu_scrolled.rs index 8b9da483..a931ccf1 100644 --- a/src/ui/widgets/horbu_scrolled.rs +++ b/src/ui/widgets/horbu_scrolled.rs @@ -69,6 +69,12 @@ glib::wrapper! { @extends gtk::Widget, adw::Bin, @implements gtk::Accessible; } +impl Default for HorbuScrolled { + fn default() -> Self { + Self::new() + } +} + impl HorbuScrolled { pub fn new() -> Self { glib::Object::new() diff --git a/src/ui/widgets/hortu_scrolled.rs b/src/ui/widgets/hortu_scrolled.rs index f3251582..f5cc7645 100644 --- a/src/ui/widgets/hortu_scrolled.rs +++ b/src/ui/widgets/hortu_scrolled.rs @@ -122,6 +122,12 @@ glib::wrapper! { @extends gtk::Widget, adw::Bin, @implements gtk::Accessible; } +impl Default for HortuScrolled { + fn default() -> Self { + Self::new() + } +} + #[template_callbacks] impl HortuScrolled { pub fn new() -> Self { diff --git a/src/ui/widgets/image_infocard.rs b/src/ui/widgets/image_infocard.rs index 8833ccaf..1627c0a8 100644 --- a/src/ui/widgets/image_infocard.rs +++ b/src/ui/widgets/image_infocard.rs @@ -151,19 +151,18 @@ impl ImageInfoCard { gtk::gdk_pixbuf::Pixbuf::from_stream_async( &stream, None::<&gio::Cancellable>, - move |r| { - match r { - Ok(pixbuf) => { - picture - .set_paintable(Some(>k::gdk::Texture::for_pixbuf(&pixbuf))); - obj.set_picture_visible(); - } - Err(_) => { - toast!(obj, gettext("Error loading image")); - obj.set_fallback_visible(); - } + move |r| match r { + Ok(pixbuf) => { + picture.set_paintable(Some(>k::gdk::Texture::for_pixbuf( + &pixbuf, + ))); + obj.set_picture_visible(); } - } + Err(_) => { + toast!(obj, gettext("Error loading image")); + obj.set_fallback_visible(); + } + }, ); } } diff --git a/src/ui/widgets/item.rs b/src/ui/widgets/item.rs index f3b9746e..4eb8346e 100644 --- a/src/ui/widgets/item.rs +++ b/src/ui/widgets/item.rs @@ -250,7 +250,9 @@ pub(crate) mod imp { let item = self.obj().item(); - if item.item_type() == "Series" || (item.item_type() == "Episode" && item.series_name().is_some()) { + if item.item_type() == "Series" + || (item.item_type() == "Episode" && item.series_name().is_some()) + { self.toolbar.set_visible(true); self.episode_list_revealer.set_reveal_child(true); self.episode_line.set_visible(true); @@ -476,9 +478,9 @@ impl ItemPage { let list = match position { 0 => { - match spawn_tokio(async move { - EMBY_CLIENT.get_continue_play_list(&series_id).await - }) + match spawn_tokio( + async move { EMBY_CLIENT.get_continue_play_list(&series_id).await }, + ) .await { Ok(item) => item.items, @@ -489,16 +491,18 @@ impl ItemPage { } } _ => { - let season_list = imp.season_list_vec.borrow(); - let Some(season) = season_list.iter().find(|s| s.name == season_name) else { - return; - }; + let season_id = { + let season_list = imp.season_list_vec.borrow(); + let Some(season) = season_list.iter().find(|s| s.name == season_name) else { + return; + }; - let season_id = season.id.clone(); + season.id.clone() + }; - match spawn_tokio(async move { - EMBY_CLIENT.get_episodes(&series_id, &season_id).await - }) + match spawn_tokio( + async move { EMBY_CLIENT.get_episodes(&series_id, &season_id).await }, + ) .await { Ok(list) => list.items, @@ -923,7 +927,7 @@ impl ItemPage { .build(); typebox.append(&icon); let label = gtk::Label::builder() - .label(&gettext(mediapart.stream_type)) + .label(gettext(mediapart.stream_type)) .attributes( >k::pango::AttrList::from_string("0 4294967295 weight bold") .expect("Failed to create attribute list"), @@ -1059,7 +1063,7 @@ impl ItemPage { "Tags" => imp.tagshorbu.get(), _ => return, }; - + horbu.set_items(&infos, type_); } diff --git a/src/ui/widgets/item_carousel.rs b/src/ui/widgets/item_carousel.rs index dbea0a3d..c802bd29 100644 --- a/src/ui/widgets/item_carousel.rs +++ b/src/ui/widgets/item_carousel.rs @@ -86,7 +86,7 @@ pub mod imp { .map(|(i, &h)| { let height_ratio = (height - h).max(0.0) / height; gtk::gsk::ColorStop::new( - f32::min(1.0, height_ratio as f32), + f32::min(1.0, height_ratio), gdk::RGBA::new( CUBIC_POINTS[i] as f32, CUBIC_POINTS[i] as f32, diff --git a/src/ui/widgets/mod.rs b/src/ui/widgets/mod.rs index c390e5cc..139c4d46 100644 --- a/src/ui/widgets/mod.rs +++ b/src/ui/widgets/mod.rs @@ -1,7 +1,6 @@ pub mod account_add; pub mod account_settings; pub mod action_row; -pub mod other; pub mod check_row; pub mod content_viewer; pub mod disc_box; @@ -25,6 +24,7 @@ pub mod logo; pub mod media_viewer; pub mod metadata_dialog; pub mod music_album; +pub mod other; pub mod picture_loader; pub mod player_toolbar; pub mod refresh_dialog; diff --git a/src/ui/widgets/music_album.rs b/src/ui/widgets/music_album.rs index 230afd84..6067ab81 100644 --- a/src/ui/widgets/music_album.rs +++ b/src/ui/widgets/music_album.rs @@ -231,7 +231,7 @@ impl AlbumPage { song_widget.add_song(item); } - for (_, disc_box) in &disc_boxes { + for disc_box in disc_boxes.values() { self.imp().listbox.append(disc_box); } } diff --git a/src/ui/widgets/other.rs b/src/ui/widgets/other.rs index 49b64015..35ff565a 100644 --- a/src/ui/widgets/other.rs +++ b/src/ui/widgets/other.rs @@ -6,16 +6,31 @@ use gtk::{ subclass::prelude::*, }; -use super::{horbu_scrolled::HorbuScrolled, picture_loader::PictureLoader}; +use super::{ + horbu_scrolled::HorbuScrolled, + picture_loader::PictureLoader, +}; use crate::{ - bing_song_model, client::{ + bing_song_model, + client::{ client::EMBY_CLIENT, error::UserFacingError, structs::*, - }, fraction, fraction_reset, toast, ui::{provider::{core_song::CoreSong, tu_item::TuItem}, widgets::song_widget::SongWidget}, utils::{ + }, + fraction, + fraction_reset, + toast, + ui::{ + provider::{ + core_song::CoreSong, + tu_item::TuItem, + }, + widgets::song_widget::SongWidget, + }, + utils::{ fetch_with_cache, CachePolicy, - } + }, }; pub(crate) mod imp { @@ -211,7 +226,7 @@ impl OtherPage { self.hortu_set_actor_list("Movie").await; self.hortu_set_actor_list("Series").await; self.hortu_set_actor_list("Episode").await; - }, + } "BoxSet" => { self.hortu_set_boxset_list().await; } @@ -228,26 +243,22 @@ impl OtherPage { } )); } - _ => { - - } + _ => {} } - - } pub fn add_external_link_horbu(&self, links: &[Urls]) { let imp = self.imp(); - imp.linkshorbu.set_links(&links); + imp.linkshorbu.set_links(links); } pub fn add_sgt_item_horbu(&self, horbu: &HorbuScrolled, items: &[SGTitem], type_: &str) { - horbu.set_items(&items, type_); + horbu.set_items(items, type_); } pub fn add_actor_item_hortu(&self, items: &[SimpleListItem]) { let hortu = self.imp().actorhortu.get(); - hortu.set_items(&items); + hortu.set_items(items); } async fn hortu_set_boxset_list(&self) { @@ -257,7 +268,9 @@ impl OtherPage { &format!("boxset_{}", id), CachePolicy::ReadCacheAndRefresh, async move { EMBY_CLIENT.get_includedby(&id).await }, - ).await { + ) + .await + { Ok(history) => history, Err(e) => { toast!(self, e.to_user_facing()); @@ -268,13 +281,11 @@ impl OtherPage { let mut movies = Vec::new(); let mut series = Vec::new(); let mut episodes = Vec::new(); - results.items.into_iter().for_each(|item| { - match item.item_type.as_str() { - "Movie" => movies.push(item), - "Series" => series.push(item), - "Episode" => episodes.push(item), - _ => {}, - } + results.items.into_iter().for_each(|item| match item.item_type.as_str() { + "Movie" => movies.push(item), + "Series" => series.push(item), + "Episode" => episodes.push(item), + _ => {} }); imp.moviehortu.set_items(&movies); diff --git a/src/ui/widgets/tu_list_item.rs b/src/ui/widgets/tu_list_item.rs index b0336c19..3b3cba9f 100644 --- a/src/ui/widgets/tu_list_item.rs +++ b/src/ui/widgets/tu_list_item.rs @@ -517,8 +517,10 @@ impl TuListItem { let item_type = self.item().item_type(); match item_type.as_str() { "Movie" | "Series" | "Episode" | "MusicVideo" => self.set_item_action(true, true, true), - "MusicAlbum" | "BoxSet" | "Tag" | "Genre" | "Views" | "Person" | "Actor" | "Director" | "Writer" | "Producer" - | "TvChannel" => self.set_item_action(false, true, true), + "MusicAlbum" | "BoxSet" | "Tag" | "Genre" | "Views" | "Person" | "Actor" + | "Director" | "Writer" | "Producer" | "TvChannel" => { + self.set_item_action(false, true, true) + } "CollectionFolder" | "UserView" | "Audio" => self.set_item_action(false, false, false), _ => None, } diff --git a/src/ui/widgets/window.rs b/src/ui/widgets/window.rs index 931ff86b..cf2afbf5 100644 --- a/src/ui/widgets/window.rs +++ b/src/ui/widgets/window.rs @@ -755,12 +755,12 @@ impl Window { T: NavigationPageExt, { let imp = self.imp(); - imp.navipage.set_title(&tag); + imp.navipage.set_title(tag); if imp.mainview.find_page(tag).is_some() { imp.mainview.pop_to_tag(tag); return; } - page.set_tag(Some(&tag)); + page.set_tag(Some(tag)); imp.mainview.push(page); imp.popbutton.set_visible(true); }