/* This file is part of jellything (https://codeberg.org/metamuffin/jellything) which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2026 metamuffin */ use jellyobject::Path; #[derive(Default)] pub struct Query { pub filter: Filter, pub sort: Sort, } #[derive(Default)] pub enum Sort { #[default] None, Value(ValueSortComponent), TextSearch(Path, String), } pub struct ValueSortComponent { pub order: SortOrder, pub path: Path, pub multi: MultiBehaviour, pub offset: Option>, } pub enum MultiBehaviour { First, ForEach, Max, Min, Count, } pub enum SortOrder { Ascending, Descending, } #[derive(Debug, Clone, Default)] pub enum Filter { #[default] True, All(Vec), Any(Vec), Match(Path, Vec), Has(Path), }