use std::collections::HashMap; use cosmic::{ Element, Task, iced::{ Background, Border, Color, Length, alignment::Vertical, clipboard::dnd::DndAction, futures::FutureExt, }, iced_core::widget::tree::State, iced_widget::{column, row as rowm, text as textm}, theme, widget::{ Container, DndSource, Space, button, container, context_menu, horizontal_space, icon, menu::{self, Action as MenuAction}, mouse_area, responsive, row, scrollable, text, text_input, }, }; use miette::{IntoDiagnostic, Result}; use rapidfuzz::distance::levenshtein; use sqlx::{Sqlite, SqlitePool, pool::PoolConnection}; use tracing::{debug, error, warn}; use crate::core::{ content::Content, images::{Image, update_image_in_db}, model::{LibraryKind, Model}, presentations::{Presentation, update_presentation_in_db}, service_items::ServiceItem, songs::{Song, update_song_in_db}, videos::{Video, update_video_in_db}, }; #[derive(Debug, Clone)] pub(crate) struct Library { song_library: Model, image_library: Model, video_library: Model