repo
stringlengths
6
65
file_url
stringlengths
81
311
file_path
stringlengths
6
227
content
stringlengths
0
32.8k
language
stringclasses
1 value
license
stringclasses
7 values
commit_sha
stringlengths
40
40
retrieved_at
stringdate
2026-01-04 15:31:58
2026-01-04 20:25:31
truncated
bool
2 classes
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/data/mod.rs
psst-gui/src/data/mod.rs
mod album; mod artist; pub mod config; mod ctx; mod find; mod id; mod nav; mod playback; mod playlist; mod promise; mod recommend; mod search; mod show; mod slider_scroll_scale; mod track; mod user; pub mod utils; use std::{ fmt::Display, mem, sync::{ atomic::{AtomicUsize, Ordering}, Arc, ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/data/nav.rs
psst-gui/src/data/nav.rs
use std::sync::Arc; use druid::Data; use serde::{Deserialize, Serialize}; use url::Url; use crate::data::track::TrackId; use crate::data::{AlbumLink, ArtistLink, PlaylistLink, ShowLink}; use super::RecommendationsRequest; #[derive(Copy, Clone, Debug, Data, PartialEq, Eq, Hash)] pub enum Route { Home, Lyrics...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/data/show.rs
psst-gui/src/data/show.rs
use std::{convert::TryFrom, sync::Arc, time::Duration}; use druid::{im::Vector, Data, Lens}; use psst_core::item_id::{ItemId, ItemIdType}; use serde::{Deserialize, Serialize}; use time::{macros::format_description, Date}; use crate::data::{Image, Promise}; use super::album::DatePrecision; #[derive(Clone, Data, Lens...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/data/ctx.rs
psst-gui/src/data/ctx.rs
use std::fmt; use druid::{ lens::{Field, Map}, widget::ListIter, Data, Lens, LensExt, }; use crate::data::Promise; #[derive(Clone, Data)] pub struct Ctx<C, T> { pub ctx: C, pub data: T, } impl<C, T> Ctx<C, T> where C: Data, T: Data, { pub fn new(c: C, t: T) -> Self { Self { c...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/user.rs
psst-gui/src/ui/user.rs
use druid::{ commands, widget::{Either, Flex, Label}, Data, LensExt, Selector, Widget, WidgetExt, }; use crate::{ data::{AppState, Library, UserProfile}, webapi::WebApi, widget::{icons, icons::SvgIcon, Async, Empty, MyWidgetExt}, }; use super::theme; pub const LOAD_PROFILE: Selector = Selecto...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/episode.rs
psst-gui/src/ui/episode.rs
use std::sync::Arc; use druid::{ widget::{CrossAxisAlignment, Flex, Label, LineBreaking}, LensExt, LocalizedString, Menu, MenuItem, Size, Widget, WidgetExt, }; use crate::{ cmd, data::{AppState, Episode, Library, Nav}, widget::{fill_between::FillBetween, FadeOut, MyWidgetExt, RemoteImage}, }; use...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/theme.rs
psst-gui/src/ui/theme.rs
use druid::{Color, Env, FontDescriptor, FontFamily, FontWeight, Insets, Key, Size}; pub use druid::theme::*; use crate::data::{AppState, Theme}; pub fn grid(m: f64) -> f64 { GRID * m } pub const GRID: f64 = 8.0; pub const GREY_000: Key<Color> = Key::new("app.grey_000"); pub const GREY_100: Key<Color> = Key::ne...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/preferences.rs
psst-gui/src/ui/preferences.rs
use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::thread::{self, JoinHandle}; use std::time::Duration; use crate::{ cmd, data::{ AppState, AudioQuality, Authentication, Config, Preferences, PreferencesTab, Promise, SliderScrollScale, Theme, }, widget::{icons, Async, Border, Checkbo...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/recommend.rs
psst-gui/src/ui/recommend.rs
use std::{sync::Arc, time::Duration}; use druid::{ widget::{CrossAxisAlignment, Flex, Slider}, FontDescriptor, FontFamily, LensExt, Selector, Widget, WidgetExt, }; use crate::{ data::{ AppState, Ctx, Recommend, Recommendations, RecommendationsKnobs, RecommendationsParams, RecommendationsRe...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/track.rs
psst-gui/src/ui/track.rs
use std::sync::Arc; use druid::{ widget::{CrossAxisAlignment, Either, Flex, Label, LineBreaking, ViewSwitcher}, Env, Lens, LensExt, LocalizedString, Menu, MenuItem, Size, TextAlignment, Widget, WidgetExt, }; use psst_core::{ audio::normalize::NormalizationLevel, item_id::{ItemId, ItemIdType}, playe...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/credits.rs
psst-gui/src/ui/credits.rs
use std::sync::Arc; use crate::widget::Empty; use crate::{ cmd, data::{AppState, ArtistLink, Nav}, ui::theme, ui::utils, }; use druid::{ widget::{Controller, CrossAxisAlignment, Either, Flex, Label, List, Maybe, Painter, Scroll}, Cursor, Data, Env, Event, EventCtx, Lens, RenderContext, Target, ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/search.rs
psst-gui/src/ui/search.rs
use std::sync::Arc; use druid::{ widget::{ CrossAxisAlignment, Either, Flex, Label, LabelText, List, MainAxisAlignment, Scroll, TextBox, }, Data, Env, Insets, Lens, LensExt, RenderContext, Selector, Widget, WidgetExt, }; use crate::{ cmd, controller::InputController, data::{App...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/find.rs
psst-gui/src/ui/find.rs
use druid::{ widget::{prelude::*, Controller, Either, Flex, Label, TextBox}, KbKey, Selector, WidgetExt, }; use crate::{ cmd, controller::InputController, data::{FindQuery, Finder, MatchFindQuery}, ui::theme, widget::{Empty, MyWidgetExt}, }; #[derive(Clone)] pub struct Find { sender: W...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/menu.rs
psst-gui/src/ui/menu.rs
use druid::{commands, platform_menus, Env, LocalizedString, Menu, MenuItem, SysMods, WindowId}; use crate::{ cmd, data::{AppState, Nav}, }; pub fn main_menu(_window: Option<WindowId>, _data: &AppState, _env: &Env) -> Menu<AppState> { if cfg!(target_os = "macos") { Menu::empty().entry(mac_app_menu(...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/home.rs
psst-gui/src/ui/home.rs
use std::sync::Arc; use druid::im::Vector; use druid::widget::{Either, Flex, Label, Scroll}; use druid::{widget::List, LensExt, Selector, Widget, WidgetExt}; use crate::data::{Artist, Ctx, HomeDetail, MixedView, Show, Shows, Track, WithCtx}; use crate::ui::library::{LOAD_SHOWS, SAVE_SHOW, UNSAVE_SHOW}; use crate::wid...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/album.rs
psst-gui/src/ui/album.rs
use std::sync::Arc; use druid::{ widget::{CrossAxisAlignment, Flex, Label, LineBreaking, List, ViewSwitcher}, LensExt, LocalizedString, Menu, MenuItem, Selector, Size, UnitPoint, Widget, WidgetExt, }; use crate::{ cmd, data::{ Album, AlbumDetail, AlbumLink, AppState, ArtistLink, Cached, Ctx, L...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/playback.rs
psst-gui/src/ui/playback.rs
use std::time::Duration; use druid::{ kurbo::{Affine, BezPath}, widget::{CrossAxisAlignment, Either, Flex, Label, LineBreaking, Spinner, ViewSwitcher}, BoxConstraints, Cursor, Data, Env, Event, EventCtx, LayoutCtx, LensExt, LifeCycle, LifeCycleCtx, MouseButton, PaintCtx, Point, Rect, RenderContext, Siz...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/library.rs
psst-gui/src/ui/library.rs
use std::sync::Arc; use druid::{ widget::{Flex, List}, LensExt, Selector, Widget, WidgetExt, }; use crate::{ cmd, data::{ Album, AlbumLink, AppState, Ctx, Library, SavedAlbums, SavedTracks, Show, ShowLink, Track, TrackId, }, ui::home::{shows_that_you_might_like, your_shows}, ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/utils.rs
psst-gui/src/ui/utils.rs
use std::{f64::consts::PI, time::Duration}; use druid::{ kurbo::Circle, widget::{prelude::*, CrossAxisAlignment, Flex, Label, SizedBox}, Data, Point, Vec2, Widget, WidgetExt, WidgetPod, }; use time_humanize::HumanTime; use crate::{data::WithCtx, error::Error, widget::icons}; use super::theme; struct Spi...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/artist.rs
psst-gui/src/ui/artist.rs
use druid::{ im::Vector, kurbo::Circle, widget::{CrossAxisAlignment, Either, Flex, Label, LabelText, LineBreaking, List, Scroll}, Data, Insets, LensExt, LocalizedString, Menu, MenuItem, Selector, Size, UnitPoint, Widget, WidgetExt, }; use crate::{ cmd, data::{ AppState, Artist, Arti...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/playlist.rs
psst-gui/src/ui/playlist.rs
use std::{cell::RefCell, cmp::Ordering, rc::Rc, sync::Arc}; use druid::{ im::Vector, widget::{Button, Either, Flex, Label, LensWrap, LineBreaking, List, TextBox}, Insets, Lens, LensExt, LocalizedString, Menu, MenuItem, Selector, Size, UnitPoint, Widget, WidgetExt, WindowDesc, }; use itertools::Itertool...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/mod.rs
psst-gui/src/ui/mod.rs
use crate::data::config::SortCriteria; use crate::data::Track; use crate::error::Error; use crate::{ cmd, controller::{ AfterDelay, AlertCleanupController, NavController, SessionController, SortController, }, data::{ config::SortOrder, Alert, AlertStyle, AppState, Config, Nav, Playable, ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/show.rs
psst-gui/src/ui/show.rs
use std::sync::Arc; use druid::{ widget::{CrossAxisAlignment, Flex, Label, LineBreaking, Scroll}, LensExt, LocalizedString, Menu, MenuItem, Selector, Size, UnitPoint, Widget, WidgetExt, }; use crate::{ cmd, data::{AppState, Ctx, Library, Nav, Show, ShowDetail, ShowEpisodes, ShowLink, WithCtx}, ui:...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/lyrics.rs
psst-gui/src/ui/lyrics.rs
use druid::widget::{Container, CrossAxisAlignment, Flex, Label, LineBreaking, List, Scroll}; use druid::{Insets, LensExt, Selector, Widget, WidgetExt}; use crate::cmd; use crate::data::{AppState, Ctx, NowPlaying, Playable, TrackLines}; use crate::widget::MyWidgetExt; use crate::{webapi::WebApi, widget::Async}; use su...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/ui/playable.rs
psst-gui/src/ui/playable.rs
use std::{mem, sync::Arc}; use druid::{ im::Vector, kurbo::Line, lens::Map, piet::StrokeStyle, widget::{Controller, ControllerHost, List, ListIter, Painter, ViewSwitcher}, Data, Env, Event, EventCtx, Lens, RenderContext, Selector, Widget, WidgetExt, }; use crate::{ cmd, data::{ ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/promise.rs
psst-gui/src/widget/promise.rs
use druid::{widget::prelude::*, Data, Point, WidgetExt, WidgetPod}; use crate::data::{Promise, PromiseState}; pub struct Async<T, D, E> { def_maker: Box<dyn Fn() -> Box<dyn Widget<D>>>, res_maker: Box<dyn Fn() -> Box<dyn Widget<T>>>, err_maker: Box<dyn Fn() -> Box<dyn Widget<E>>>, widget: PromiseWidge...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/link.rs
psst-gui/src/widget/link.rs
use druid::{widget::prelude::*, Color, Data, KeyOrValue, Point, RoundedRectRadii, WidgetPod}; use crate::ui::theme; pub struct Link<T> { inner: WidgetPod<T, Box<dyn Widget<T>>>, border_color: KeyOrValue<Color>, border_width: KeyOrValue<f64>, corner_radius: KeyOrValue<RoundedRectRadii>, is_active: ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/theme.rs
psst-gui/src/widget/theme.rs
use crate::{data::AppState, ui::theme}; use druid::widget::prelude::*; pub struct ThemeScope<W> { inner: W, cached_env: Option<Env>, } impl<W> ThemeScope<W> { pub fn new(inner: W) -> Self { Self { inner, cached_env: None, } } fn set_env(&mut self, data: &Ap...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/empty.rs
psst-gui/src/widget/empty.rs
use druid::widget::prelude::*; pub struct Empty; impl<T> Widget<T> for Empty { fn event(&mut self, _ctx: &mut EventCtx, _event: &Event, _data: &mut T, _env: &Env) {} fn lifecycle(&mut self, _ctx: &mut LifeCycleCtx, _event: &LifeCycle, _data: &T, _env: &Env) {} fn update(&mut self, _ctx: &mut UpdateCtx, _o...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/icons.rs
psst-gui/src/widget/icons.rs
use crate::ui::theme; use druid::{kurbo::BezPath, widget::prelude::*, Affine, Color, KeyOrValue, Size}; #[allow(dead_code)] pub static LOGO: SvgIcon = SvgIcon { svg_path: "M2.34146 0.685791L28.5825 26.9268L26.9268 28.5825L0.685791 2.34145L2.34146 0.685791Z M22.2439 11.7073V15.2195C22.2441 15.8464 22.1721 16.4712 2...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
true
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/dispatcher.rs
psst-gui/src/widget/dispatcher.rs
use std::{collections::HashMap, hash::Hash}; use druid::{widget::prelude::*, Data, Point, WidgetPod}; type ChildPicker<T, U> = dyn Fn(&T, &Env) -> U; type ChildBuilder<T, U> = dyn Fn(&U, &T, &Env) -> Box<dyn Widget<T>>; pub struct ViewDispatcher<T, U> { child_picker: Box<ChildPicker<T, U>>, child_builder: Bo...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/utils.rs
psst-gui/src/widget/utils.rs
use druid::{ kurbo::{Line, Shape}, widget::{prelude::*, Axis, BackgroundBrush, Painter}, Color, Data, KeyOrValue, }; pub struct FadeOut<W> { inner: W, axis: Axis, limit: KeyOrValue<f64>, color: KeyOrValue<Color>, over_limit: bool, } impl<W> FadeOut<W> { // const FADE_LENGTH_MAX: f6...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/mod.rs
psst-gui/src/widget/mod.rs
mod checkbox; mod dispatcher; mod empty; pub mod fill_between; pub mod icons; mod link; mod maybe; mod overlay; mod promise; pub mod remote_image; mod theme; mod utils; use std::{sync::Arc, time::Duration}; use druid::{ widget::{ControllerHost, Padding}, Data, Env, EventCtx, Insets, Menu, MouseButton, MouseEv...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/remote_image.rs
psst-gui/src/widget/remote_image.rs
use std::sync::Arc; use druid::{ widget::{prelude::*, FillStrat, Image}, Data, ImageBuf, Point, Selector, WidgetPod, }; pub const REQUEST_DATA: Selector<Arc<str>> = Selector::new("remote-image.request-data"); pub const PROVIDE_DATA: Selector<ImagePayload> = Selector::new("remote-image.provide-data"); #[deriv...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/checkbox.rs
psst-gui/src/widget/checkbox.rs
use druid::{ kurbo::{BezPath, Size}, piet::{LineCap, LineJoin, LinearGradient, RenderContext, StrokeStyle, UnitPoint}, theme, widget::{prelude::*, Label, LabelText}, Affine, }; pub struct Checkbox { label: Label<bool>, } impl Checkbox { pub fn new(text: impl Into<LabelText<bool>>) -> Check...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/overlay.rs
psst-gui/src/widget/overlay.rs
use druid::{widget::prelude::*, Data, Point, Vec2, WidgetPod}; pub enum OverlayPosition { Bottom, } pub struct Overlay<T, W, O> { inner: W, overlay: WidgetPod<T, O>, position: OverlayPosition, } impl<T, W, O> Overlay<T, W, O> where O: Widget<T>, { pub fn bottom(inner: W, overlay: O) -> Self {...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/maybe.rs
psst-gui/src/widget/maybe.rs
// Copyright 2020 The xi-editor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-gui/src/widget/fill_between.rs
psst-gui/src/widget/fill_between.rs
use druid::{ BoxConstraints, Data, Env, Event, EventCtx, LayoutCtx, LifeCycle, LifeCycleCtx, PaintCtx, Point, Size, UpdateCtx, Widget, WidgetPod, }; /// A widget that positions two children, allowing the right child to fill the remaining space. /// The left child is measured first, and the right child is given...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-cli/src/main.rs
psst-cli/src/main.rs
use psst_core::{ audio::{ normalize::NormalizationLevel, output::{AudioOutput, AudioSink, DefaultAudioOutput}, }, cache::{Cache, CacheHandle}, cdn::{Cdn, CdnHandle}, connection::Credentials, error::Error, item_id::{ItemId, ItemIdType}, player::{item::PlaybackItem, Playbac...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/build.rs
psst-core/build.rs
use gix_config::File; use std::{env, fs, io::Write}; use time::OffsetDateTime; fn main() { let outdir = env::var("OUT_DIR").unwrap(); let outfile = format!("{outdir}/build-time.txt"); let mut fh = fs::File::create(outfile).unwrap(); let now = OffsetDateTime::now_local().unwrap_or_else(|_| OffsetDateTi...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/lib.rs
psst-core/src/lib.rs
#![allow(clippy::new_without_default)] use git_version::git_version; pub const GIT_VERSION: &str = git_version!(); pub const BUILD_TIME: &str = include!(concat!(env!("OUT_DIR"), "/build-time.txt")); pub const REMOTE_URL: &str = include!(concat!(env!("OUT_DIR"), "/remote-url.txt")); pub mod actor; pub mod audio; pub ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/item_id.rs
psst-core/src/item_id.rs
use std::{ collections::HashMap, convert::TryInto, fmt, ops::Deref, path::PathBuf, sync::{LazyLock, Mutex}, }; static LOCAL_REGISTRY: LazyLock<Mutex<LocalItemRegistry>> = LazyLock::new(|| Mutex::new(LocalItemRegistry::new())); // LocalItemRegistry allows generating IDs for local music file...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/actor.rs
psst-core/src/actor.rs
use std::{ fmt::Display, thread::{self, JoinHandle}, time::Duration, }; use crossbeam_channel::{ bounded, unbounded, Receiver, RecvTimeoutError, SendError, Sender, TrySendError, }; pub enum Act<T: Actor> { Continue, WaitOr { timeout: Duration, timeout_msg: T::Message, }, ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/cdn.rs
psst-core/src/cdn.rs
use std::{ io::Read, sync::Arc, time::{Duration, Instant}, }; use serde::Deserialize; use crate::{ error::Error, item_id::FileId, session::{SessionService}, util::default_ureq_agent_builder, }; use crate::session::login5::Login5; pub type CdnHandle = Arc<Cdn>; pub struct Cdn { sessio...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/error.rs
psst-core/src/error.rs
use std::sync::mpsc::RecvTimeoutError; use std::{error, fmt, io}; #[derive(Debug)] pub enum Error { SessionDisconnected, UnexpectedResponse, MediaFileNotFound, ProxyUrlInvalid, AuthFailed { code: i32 }, ConnectionFailed, JsonError(Box<dyn error::Error + Send>), InvalidStateError(Box<dyn...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/oauth.rs
psst-core/src/oauth.rs
use crate::error::Error; use oauth2::{ basic::BasicClient, reqwest::http_client, AuthUrl, AuthorizationCode, ClientId, CsrfToken, PkceCodeChallenge, PkceCodeVerifier, RedirectUrl, Scope, TokenResponse, TokenUrl, }; use std::{ io::{BufRead, BufReader, Write}, net::TcpStream, net::{IpAddr, Ipv4Addr, S...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/util.rs
psst-core/src/util.rs
use crate::error::Error; use byteorder::{BigEndian, ByteOrder}; use num_traits::{One, WrappingAdd}; use sha1::{Digest, Sha1}; use std::time::Instant; use std::{io, io::SeekFrom, mem, time::Duration}; pub const NET_CONNECT_TIMEOUT: Duration = Duration::from_millis(8 * 1000); pub const NET_IO_TIMEOUT: Duration = Durati...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/lastfm.rs
psst-core/src/lastfm.rs
use crate::error::Error; use crate::oauth::listen_for_callback_parameter; use rustfm_scrobble::{responses::SessionResponse, Scrobble, Scrobbler, ScrobblerError}; use std::{net::SocketAddr, time::Duration}; use url::Url; pub struct LastFmClient; impl LastFmClient { /// Report a track as "now playing" to Last.fm us...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/cache.rs
psst-core/src/cache.rs
use std::{ fs, io, path::{Path, PathBuf}, sync::Arc, }; use crate::{ audio::decrypt::AudioKey, error::Error, item_id::{FileId, ItemId}, }; use librespot_protocol::metadata::{Episode, Track}; use protobuf::Message; pub type CacheHandle = Arc<Cache>; #[derive(Debug)] pub struct Cache { bas...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/system_info.rs
psst-core/src/system_info.rs
/// Operating System as given by the Rust standard library pub const OS: &str = std::env::consts::OS; /// Device ID used for authentication procedures. /// librespot opts for UUIDv4s instead pub const DEVICE_ID: &str = "Psst"; /// Client ID for desktop keymaster client pub const CLIENT_ID: &str = "65b708073fc0480ea92...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/metadata.rs
psst-core/src/metadata.rs
use std::time::Duration; use crate::{ error::Error, item_id::{FileId, ItemId, ItemIdType}, player::file::{AudioFormat, MediaFile, MediaPath}, session::SessionService, }; use librespot_protocol::metadata::restriction::Country_restriction; use librespot_protocol::metadata::{AudioFile, Episode, Restricti...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/connection/diffie_hellman.rs
psst-core/src/connection/diffie_hellman.rs
use num_bigint::{BigUint, ToBigUint}; use rand::Rng; pub struct DHLocalKeys { private_key: BigUint, public_key: BigUint, } impl DHLocalKeys { pub fn random() -> DHLocalKeys { let private_key = rand::rng().random::<u32>().to_biguint().unwrap(); let public_key = dh_generator().modpow(&privat...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/connection/shannon_codec.rs
psst-core/src/connection/shannon_codec.rs
use std::{convert::TryInto, io}; use shannon::Shannon; #[derive(Debug)] pub struct ShannonMsg { pub cmd: u8, pub payload: Vec<u8>, } impl ShannonMsg { pub const SECRET_BLOCK: u8 = 0x02; pub const PING: u8 = 0x04; pub const STREAM_CHUNK: u8 = 0x08; pub const STREAM_CHUNK_RES: u8 = 0x09; pu...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/connection/mod.rs
psst-core/src/connection/mod.rs
pub mod diffie_hellman; pub mod shannon_codec; use std::{ convert::TryInto, io, io::{Read, Write}, net::{TcpStream, ToSocketAddrs}, }; use byteorder::{ReadBytesExt, BE}; use hmac::{Hmac, Mac}; use serde::{Deserialize, Serialize}; use sha1::Sha1; use socks::Socks5Stream; use url::Url; use crate::{ ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/source.rs
psst-core/src/audio/source.rs
use crate::audio::resample::ResamplingSpec; use super::resample::{AudioResampler, ResamplingQuality}; /// Types that can produce audio samples in `f32` format. `Send`able across /// threads. pub trait AudioSource: Send + 'static { /// Write at most of `output.len()` samples into the `output`. Returns the /// ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/decode.rs
psst-core/src/audio/decode.rs
use std::{io, time::Duration}; use symphonia::{ core::{ audio::{SampleBuffer, SignalSpec}, codecs::{CodecParameters, Decoder, DecoderOptions}, conv::ConvertibleSample, errors::Error as SymphoniaError, formats::{FormatOptions, FormatReader, SeekMode, SeekTo}, io::{Med...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/decrypt.rs
psst-core/src/audio/decrypt.rs
use std::{convert::TryInto, io}; use aes::{ cipher::{generic_array::GenericArray, KeyIvInit, StreamCipher, StreamCipherSeek}, Aes128, }; use ctr::Ctr128BE; const AUDIO_AESIV: [u8; 16] = [ 0x72, 0xe0, 0x67, 0xfb, 0xdd, 0xcb, 0xcf, 0x77, 0xeb, 0xe8, 0xbc, 0x64, 0x3f, 0x63, 0x0d, 0x93, ]; #[derive(Debug, Ha...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/resample.rs
psst-core/src/audio/resample.rs
use crate::error::Error; #[derive(Copy, Clone)] pub enum ResamplingQuality { SincBestQuality = libsamplerate::SRC_SINC_BEST_QUALITY as isize, SincMediumQuality = libsamplerate::SRC_SINC_MEDIUM_QUALITY as isize, SincFastest = libsamplerate::SRC_SINC_FASTEST as isize, ZeroOrderHold = libsamplerate::SRC_Z...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/mod.rs
psst-core/src/audio/mod.rs
pub mod decode; pub mod decrypt; pub mod normalize; pub mod output; pub mod probe; pub mod resample; pub mod source;
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/normalize.rs
psst-core/src/audio/normalize.rs
use std::{ io, io::{Read, Seek, SeekFrom}, }; use byteorder::{ReadBytesExt, LE}; #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum NormalizationLevel { None, Track, Album, } #[derive(Clone, Copy)] pub struct NormalizationData { track_gain_db: f32, track_peak: f32, album_gain_db: f...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/probe.rs
psst-core/src/audio/probe.rs
use std::fs::File; use std::path::PathBuf; use std::time::Duration; use symphonia::core::codecs::CodecType; use symphonia::core::formats::FormatOptions; use symphonia::core::io::{MediaSourceStream, MediaSourceStreamOptions}; use symphonia::core::meta::MetadataOptions; use symphonia::core::probe::{Hint, Probe}; use sym...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/output/cpal.rs
psst-core/src/audio/output/cpal.rs
use cpal::traits::{DeviceTrait, HostTrait, StreamTrait}; use crossbeam_channel::{bounded, Receiver, Sender}; use num_traits::Pow; use crate::{ actor::{Act, Actor, ActorHandle}, audio::{ output::{AudioOutput, AudioSink}, source::{AudioSource, Empty}, }, error::Error, }; pub struct CpalO...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/output/mod.rs
psst-core/src/audio/output/mod.rs
use crate::audio::source::AudioSource; #[cfg(feature = "cpal")] pub mod cpal; #[cfg(feature = "cubeb")] pub mod cubeb; #[cfg(feature = "cubeb")] pub type DefaultAudioOutput = cubeb::CubebOutput; #[cfg(feature = "cpal")] pub type DefaultAudioOutput = cpal::CpalOutput; pub type DefaultAudioSink = <DefaultAudioOutput a...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/audio/output/cubeb.rs
psst-core/src/audio/output/cubeb.rs
use std::{env, ffi::CString, ops::Deref}; use crossbeam_channel::{bounded, Receiver, Sender}; use crate::{ actor::{Act, Actor, ActorHandle}, audio::{ output::{AudioOutput, AudioSink}, source::{AudioSource, Empty}, }, error::Error, }; pub struct CubebOutput { #[allow(unused)] h...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/session/access_token.rs
psst-core/src/session/access_token.rs
use std::time::{Duration, Instant}; use parking_lot::Mutex; use serde::Deserialize; use crate::error::Error; use super::SessionService; // Client ID of the official Web Spotify front-end. pub const CLIENT_ID: &str = "65b708073fc0480ea92a077233ca87bd"; // All scopes we could possibly require. pub const ACCESS_SCOPE...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/session/audio_key.rs
psst-core/src/session/audio_key.rs
use std::{ collections::HashMap, io::{Cursor, Read}, }; use byteorder::{ReadBytesExt, BE}; use crossbeam_channel::Sender; use crate::{ audio::decrypt::AudioKey, connection::shannon_codec::ShannonMsg, error::Error, item_id::{FileId, ItemId}, util::Sequence, }; pub struct AudioKeyDispatcher...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/session/mod.rs
psst-core/src/session/mod.rs
pub mod access_token; pub mod audio_key; pub mod mercury; pub mod login5; pub mod client_token; pub mod token; use std::{ io, net::{Shutdown, TcpStream}, sync::{ atomic::{AtomicBool, Ordering}, Arc, }, thread::{self, JoinHandle}, }; use crossbeam_channel::{unbounded, Receiver, Send...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/session/client_token.rs
psst-core/src/session/client_token.rs
// Ported from librespot use crate::error::Error; use crate::session::token::{Token}; use crate::util::{default_ureq_agent_builder, solve_hash_cash}; use data_encoding::HEXUPPER_PERMISSIVE; use librespot_protocol::clienttoken_http::{ ChallengeAnswer, ChallengeType, ClientTokenRequest, ClientTokenRequestType, C...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/session/login5.rs
psst-core/src/session/login5.rs
// Ported from librespot use crate::error::Error; use crate::session::client_token::ClientTokenProvider; use crate::session::token::Token; use crate::session::SessionService; use crate::system_info::{CLIENT_ID, DEVICE_ID}; use crate::util::{default_ureq_agent_builder, solve_hash_cash}; use librespot_protocol::login5::...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/session/mercury.rs
psst-core/src/session/mercury.rs
use std::{ collections::HashMap, io::{Cursor, Read}, }; use byteorder::{ReadBytesExt, BE}; use crossbeam_channel::Sender; use crate::{connection::shannon_codec::ShannonMsg, util::Sequence}; use librespot_protocol::mercury::Header; use protobuf::Message; pub struct MercuryDispatcher { sequence: Sequence<...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/session/token.rs
psst-core/src/session/token.rs
// Ported from librespot use std::time::{Duration, Instant}; const EXPIRY_THRESHOLD: Duration = Duration::from_secs(10); #[derive(Clone, Debug)] pub struct Token { pub access_token: String, pub expires_in: Duration, pub token_type: String, pub scopes: Vec<String>, pub timestamp: Instant, } impl ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/player/storage.rs
psst-core/src/player/storage.rs
use std::{ fs::File, io, io::{Read, Seek, SeekFrom, Write}, ops::Range, path::{Path, PathBuf}, sync::Arc, }; use crossbeam_channel::{unbounded, Receiver, Sender}; use parking_lot::{Condvar, Mutex}; use rangemap::RangeSet; use tempfile::NamedTempFile; pub enum StreamRequest { Preload { offs...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/player/file.rs
psst-core/src/player/file.rs
use std::{ fs, io, io::{Seek, SeekFrom}, path::PathBuf, sync::Arc, thread, thread::JoinHandle, time::Duration, }; use symphonia::core::codecs::CodecType; use crate::{ audio::{ decode::{AudioCodecFormat, AudioDecoder}, decrypt::{AudioDecrypt, AudioKey}, normalize...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/player/worker.rs
psst-core/src/player/worker.rs
use std::{ ops::Range, sync::{ atomic::{AtomicU64, Ordering}, Arc, }, time::Duration, }; use crossbeam_channel::Sender; use rb::{Consumer, Producer, RbConsumer, RbProducer, SpscRb, RB}; use symphonia::core::{ audio::{SampleBuffer, SignalSpec}, units::TimeBase, }; use crate::{ ...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/player/mod.rs
psst-core/src/player/mod.rs
pub mod file; pub mod item; pub mod queue; mod storage; mod worker; use std::{mem, thread, thread::JoinHandle, time::Duration}; use crossbeam_channel::{unbounded, Receiver, Sender}; use crate::{ audio::output::{AudioOutput, AudioSink, DefaultAudioOutput, DefaultAudioSink}, cache::CacheHandle, cdn::CdnHan...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/player/item.rs
psst-core/src/player/item.rs
use std::time::Duration; use crate::{ audio::{ decode::AudioDecoder, decrypt::AudioKey, normalize::NormalizationLevel, probe::TrackProbe, }, cache::CacheHandle, cdn::CdnHandle, error::Error, item_id::{ItemId, ItemIdType, LocalItemRegistry}, metadata::{Fetch, ToMediaPath}, sessio...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
jpochyla/psst
https://github.com/jpochyla/psst/blob/ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd/psst-core/src/player/queue.rs
psst-core/src/player/queue.rs
use rand::prelude::SliceRandom; use super::PlaybackItem; #[derive(Default, Debug)] pub enum QueueBehavior { #[default] Sequential, Random, LoopTrack, LoopAll, } pub struct Queue { items: Vec<PlaybackItem>, user_items: Vec<PlaybackItem>, position: usize, user_items_position: usize,...
rust
MIT
ae4f16dbc9faf090fabb015d2fb7125e11ed6dfd
2026-01-04T15:46:03.699069Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/serve.rs
src/serve.rs
use crate::{client::*, config::*, function::*, rag::*, utils::*}; use anyhow::{anyhow, bail, Result}; use bytes::Bytes; use chrono::{Timelike, Utc}; use futures_util::StreamExt; use http::{Method, Response, StatusCode}; use http_body_util::{combinators::BoxBody, BodyExt, Full, StreamBody}; use hyper::{ body::{Fram...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
true
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/cli.rs
src/cli.rs
use anyhow::{Context, Result}; use clap::Parser; use is_terminal::IsTerminal; use std::io::{stdin, Read}; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] pub struct Cli { /// Select a LLM model #[clap(short, long)] pub model: Option<String>, /// Use the system prompt ...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/function.rs
src/function.rs
use crate::{ config::{Agent, Config, GlobalConfig}, utils::*, }; use anyhow::{anyhow, bail, Context, Result}; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; use serde_json::{json, Value}; use std::{ collections::{HashMap, HashSet}, fs, path::{Path, PathBuf}, }; #[cfg(windows)] const ...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/main.rs
src/main.rs
mod cli; mod client; mod config; mod function; mod rag; mod render; mod repl; mod serve; #[macro_use] mod utils; #[macro_use] extern crate log; use crate::cli::Cli; use crate::client::{ call_chat_completions, call_chat_completions_streaming, list_models, ModelType, }; use crate::config::{ ensure_parent_exists...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/repl/highlighter.rs
src/repl/highlighter.rs
use super::REPL_COMMANDS; use crate::{config::GlobalConfig, utils::NO_COLOR}; use nu_ansi_term::{Color, Style}; use reedline::{Highlighter, StyledText}; const DEFAULT_COLOR: Color = Color::Default; const MATCH_COLOR: Color = Color::Green; pub struct ReplHighlighter; impl ReplHighlighter { pub fn new(_config: &...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/repl/prompt.rs
src/repl/prompt.rs
use crate::config::GlobalConfig; use reedline::{Prompt, PromptHistorySearch, PromptHistorySearchStatus}; use std::borrow::Cow; #[derive(Clone)] pub struct ReplPrompt { config: GlobalConfig, } impl ReplPrompt { pub fn new(config: &GlobalConfig) -> Self { Self { config: config.clone(), ...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/repl/mod.rs
src/repl/mod.rs
mod completer; mod highlighter; mod prompt; use self::completer::ReplCompleter; use self::highlighter::ReplHighlighter; use self::prompt::ReplPrompt; use crate::client::{call_chat_completions, call_chat_completions_streaming}; use crate::config::{ macro_execute, AgentVariables, AssertState, Config, GlobalConfig, ...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/repl/completer.rs
src/repl/completer.rs
use super::{ReplCommand, REPL_COMMANDS}; use crate::{config::GlobalConfig, utils::fuzzy_filter}; use reedline::{Completer, Span, Suggestion}; use std::collections::HashMap; impl Completer for ReplCompleter { fn complete(&mut self, line: &str, pos: usize) -> Vec<Suggestion> { let mut suggestions = vec![];...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/rag/mod.rs
src/rag/mod.rs
use self::splitter::*; use crate::client::*; use crate::config::*; use crate::utils::*; mod serde_vectors; mod splitter; use anyhow::{anyhow, bail, Context, Result}; use bm25::{Language, SearchEngine, SearchEngineBuilder}; use hnsw_rs::prelude::*; use indexmap::{IndexMap, IndexSet}; use inquire::{required, validator...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
true
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/rag/serde_vectors.rs
src/rag/serde_vectors.rs
use super::*; use base64::{engine::general_purpose::STANDARD, Engine}; use serde::{de, Deserializer, Serializer}; pub fn serialize<S>( vectors: &IndexMap<DocumentId, Vec<f32>>, serializer: S, ) -> Result<S::Ok, S::Error> where S: Serializer, { let encoded_map: IndexMap<String, String> = vectors ...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/rag/splitter/language.rs
src/rag/splitter/language.rs
#[derive(PartialEq, Eq, Hash)] pub enum Language { Cpp, Go, Java, Js, Php, Proto, Python, Rst, Ruby, Rust, Scala, Swift, Markdown, Latex, Html, Sol, } impl Language { pub fn separators(&self) -> Vec<&str> { match self { Language::C...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/rag/splitter/mod.rs
src/rag/splitter/mod.rs
mod language; pub use self::language::*; use super::{DocumentMetadata, RagDocument}; pub const DEFAULT_SEPARATES: [&str; 4] = ["\n\n", "\n", " ", ""]; pub fn get_separators(extension: &str) -> Vec<&'static str> { match extension { "c" | "cc" | "cpp" => Language::Cpp.separators(), "go" => Languag...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/html_to_md.rs
src/utils/html_to_md.rs
use std::{cell::RefCell, rc::Rc}; use html_to_markdown::{markdown, TagHandler}; pub fn html_to_md(html: &str) -> String { let mut handlers: Vec<TagHandler> = vec![ Rc::new(RefCell::new(markdown::ParagraphHandler)), Rc::new(RefCell::new(markdown::HeadingHandler)), Rc::new(RefCell::new(markd...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/variables.rs
src/utils/variables.rs
use super::*; use fancy_regex::{Captures, Regex}; use std::sync::LazyLock; pub static RE_VARIABLE: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"\{\{(\w+)\}\}").unwrap()); pub fn interpolate_variables(text: &mut String) { *text = RE_VARIABLE .replace_all(text, |caps: &Captures<'_>| { let key ...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/path.rs
src/utils/path.rs
use std::path::{Component, Path, PathBuf}; use anyhow::{bail, Result}; use indexmap::IndexSet; use path_absolutize::Absolutize; pub fn safe_join_path<T1: AsRef<Path>, T2: AsRef<Path>>( base_path: T1, sub_path: T2, ) -> Option<PathBuf> { let base_path = base_path.as_ref(); let sub_path = sub_path.as_re...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/command.rs
src/utils/command.rs
use super::*; use std::{ collections::HashMap, env, ffi::OsStr, fs::OpenOptions, io::{self, Write}, path::{Path, PathBuf}, process::Command, }; use anyhow::{anyhow, bail, Context, Result}; use dirs::home_dir; use std::sync::LazyLock; pub static SHELL: LazyLock<Shell> = LazyLock::new(detec...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/abort_signal.rs
src/utils/abort_signal.rs
use anyhow::Result; use crossterm::event::{self, Event, KeyCode, KeyModifiers}; use std::{ sync::{ atomic::{AtomicBool, Ordering}, Arc, }, time::Duration, }; pub type AbortSignal = Arc<AbortSignalInner>; pub struct AbortSignalInner { ctrlc: AtomicBool, ctrld: AtomicBool, } pub fn ...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/clipboard.rs
src/utils/clipboard.rs
use anyhow::Context; #[cfg(not(any(target_os = "android", target_os = "emscripten")))] mod internal { use arboard::Clipboard; use base64::{engine::general_purpose::STANDARD, Engine as _}; use std::sync::{LazyLock, Mutex}; static CLIPBOARD: LazyLock<Mutex<Option<Clipboard>>> = LazyLock::new(|| ...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/mod.rs
src/utils/mod.rs
mod abort_signal; mod clipboard; mod command; mod crypto; mod html_to_md; mod input; mod loader; mod path; mod render_prompt; mod request; mod spinner; mod variables; pub use self::abort_signal::*; pub use self::clipboard::set_text; pub use self::command::*; pub use self::crypto::*; pub use self::html_to_md::*; pub us...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/loader.rs
src/utils/loader.rs
use super::*; use anyhow::{anyhow, Context, Result}; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; use std::collections::HashMap; pub const EXTENSION_METADATA: &str = "__extension__"; pub type DocumentMetadata = IndexMap<String, String>; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Load...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/request.rs
src/utils/request.rs
use super::*; use anyhow::{anyhow, bail, Context, Result}; use fancy_regex::Regex; use futures_util::{stream, StreamExt}; use http::header::CONTENT_TYPE; use reqwest::Url; use scraper::{Html, Selector}; use serde::Deserialize; use serde_json::Value; use std::sync::LazyLock; use std::{ collections::{HashMap, HashSe...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/crypto.rs
src/utils/crypto.rs
use base64::{engine::general_purpose::STANDARD, Engine}; use hmac::{Hmac, Mac}; use sha2::{Digest, Sha256}; pub fn sha256(input: &str) -> String { let mut hasher = Sha256::new(); hasher.update(input); format!("{:x}", hasher.finalize()) } pub fn hmac_sha256(key: &[u8], msg: &str) -> Vec<u8> { let mut m...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false
sigoden/aichat
https://github.com/sigoden/aichat/blob/4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c/src/utils/spinner.rs
src/utils/spinner.rs
use super::{poll_abort_signal, wait_abort_signal, AbortSignal, IS_STDOUT_TERMINAL}; use anyhow::{bail, Result}; use crossterm::{cursor, queue, style, terminal}; use std::{ future::Future, io::{stdout, Write}, time::Duration, }; use tokio::{ sync::{ mpsc::{self, UnboundedReceiver}, onesh...
rust
Apache-2.0
4ddc28d40c238bb67d750d022bd3ca8a1a31cd0c
2026-01-04T15:46:26.794088Z
false