From 1dedd8b327cd59b1743f79ad640ff78d462cd87d Mon Sep 17 00:00:00 2001 From: trivernis Date: Wed, 19 Jan 2022 20:00:41 +0100 Subject: [PATCH] Rename mediarepo-model to mediarepo-logic crate Signed-off-by: trivernis --- mediarepo-daemon/Cargo.lock | 6 +++--- mediarepo-daemon/Cargo.toml | 10 +++++----- .../{mediarepo-model => mediarepo-logic}/.gitignore | 0 .../{mediarepo-model => mediarepo-logic}/Cargo.toml | 2 +- .../src/content_descriptor.rs | 0 .../src/file/filter.rs | 0 .../src/file/mod.rs | 0 .../src/file_metadata.rs | 0 .../{mediarepo-model => mediarepo-logic}/src/lib.rs | 0 .../src/namespace.rs | 0 .../{mediarepo-model => mediarepo-logic}/src/repo.rs | 0 .../{mediarepo-model => mediarepo-logic}/src/tag.rs | 0 .../src/thumbnail.rs | 0 .../src/type_keys.rs | 0 mediarepo-daemon/mediarepo-socket/Cargo.toml | 4 ++-- mediarepo-daemon/mediarepo-socket/src/from_model.rs | 10 +++++----- mediarepo-daemon/mediarepo-socket/src/lib.rs | 4 ++-- .../mediarepo-socket/src/namespaces/files/searching.rs | 8 ++++---- .../mediarepo-socket/src/namespaces/files/sorting.rs | 6 +++--- mediarepo-daemon/mediarepo-socket/src/utils.rs | 6 +++--- mediarepo-daemon/src/main.rs | 2 +- mediarepo-daemon/src/utils.rs | 2 +- 22 files changed, 30 insertions(+), 30 deletions(-) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/.gitignore (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/Cargo.toml (91%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/content_descriptor.rs (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/file/filter.rs (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/file/mod.rs (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/file_metadata.rs (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/lib.rs (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/namespace.rs (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/repo.rs (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/tag.rs (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/thumbnail.rs (100%) rename mediarepo-daemon/{mediarepo-model => mediarepo-logic}/src/type_keys.rs (100%) diff --git a/mediarepo-daemon/Cargo.lock b/mediarepo-daemon/Cargo.lock index 3112994..3643f40 100644 --- a/mediarepo-daemon/Cargo.lock +++ b/mediarepo-daemon/Cargo.lock @@ -1225,7 +1225,7 @@ dependencies = [ "glob", "log", "mediarepo-core", - "mediarepo-model", + "mediarepo-logic", "mediarepo-socket", "num-integer", "rolling-file", @@ -1251,7 +1251,7 @@ dependencies = [ ] [[package]] -name = "mediarepo-model" +name = "mediarepo-logic" version = "0.1.0" dependencies = [ "async-trait", @@ -1275,7 +1275,7 @@ dependencies = [ "compare", "mediarepo-core", "mediarepo-database", - "mediarepo-model", + "mediarepo-logic", "port_check", "rayon", "serde 1.0.132", diff --git a/mediarepo-daemon/Cargo.toml b/mediarepo-daemon/Cargo.toml index acca829..8a95499 100644 --- a/mediarepo-daemon/Cargo.toml +++ b/mediarepo-daemon/Cargo.toml @@ -1,6 +1,6 @@ [workspace] -members = ["mediarepo-core", "mediarepo-database", "mediarepo-model", "mediarepo-socket", "."] -default-members = ["mediarepo-core", "mediarepo-database", "mediarepo-model", "mediarepo-socket", "."] +members = ["mediarepo-core", "mediarepo-database", "mediarepo-logic", "mediarepo-socket", "."] +default-members = ["mediarepo-core", "mediarepo-database", "mediarepo-logic", "mediarepo-socket", "."] [package] name = "mediarepo-daemon" @@ -31,8 +31,8 @@ log = "^0.4.14" [dependencies.mediarepo-core] path = "./mediarepo-core" -[dependencies.mediarepo-model] -path = "./mediarepo-model" +[dependencies.mediarepo-logic] +path = "mediarepo-logic" [dependencies.mediarepo-socket] path = "./mediarepo-socket" @@ -47,4 +47,4 @@ features = ["env-filter", "ansi", "json"] [features] default = ["ffmpeg"] -ffmpeg = ["mediarepo-core/ffmpeg", "mediarepo-model/ffmpeg"] \ No newline at end of file +ffmpeg = ["mediarepo-core/ffmpeg", "mediarepo-logic/ffmpeg"] \ No newline at end of file diff --git a/mediarepo-daemon/mediarepo-model/.gitignore b/mediarepo-daemon/mediarepo-logic/.gitignore similarity index 100% rename from mediarepo-daemon/mediarepo-model/.gitignore rename to mediarepo-daemon/mediarepo-logic/.gitignore diff --git a/mediarepo-daemon/mediarepo-model/Cargo.toml b/mediarepo-daemon/mediarepo-logic/Cargo.toml similarity index 91% rename from mediarepo-daemon/mediarepo-model/Cargo.toml rename to mediarepo-daemon/mediarepo-logic/Cargo.toml index 0f14d81..75cab7b 100644 --- a/mediarepo-daemon/mediarepo-model/Cargo.toml +++ b/mediarepo-daemon/mediarepo-logic/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "mediarepo-model" +name = "mediarepo-logic" version = "0.1.0" edition = "2018" workspace = ".." diff --git a/mediarepo-daemon/mediarepo-model/src/content_descriptor.rs b/mediarepo-daemon/mediarepo-logic/src/content_descriptor.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/content_descriptor.rs rename to mediarepo-daemon/mediarepo-logic/src/content_descriptor.rs diff --git a/mediarepo-daemon/mediarepo-model/src/file/filter.rs b/mediarepo-daemon/mediarepo-logic/src/file/filter.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/file/filter.rs rename to mediarepo-daemon/mediarepo-logic/src/file/filter.rs diff --git a/mediarepo-daemon/mediarepo-model/src/file/mod.rs b/mediarepo-daemon/mediarepo-logic/src/file/mod.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/file/mod.rs rename to mediarepo-daemon/mediarepo-logic/src/file/mod.rs diff --git a/mediarepo-daemon/mediarepo-model/src/file_metadata.rs b/mediarepo-daemon/mediarepo-logic/src/file_metadata.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/file_metadata.rs rename to mediarepo-daemon/mediarepo-logic/src/file_metadata.rs diff --git a/mediarepo-daemon/mediarepo-model/src/lib.rs b/mediarepo-daemon/mediarepo-logic/src/lib.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/lib.rs rename to mediarepo-daemon/mediarepo-logic/src/lib.rs diff --git a/mediarepo-daemon/mediarepo-model/src/namespace.rs b/mediarepo-daemon/mediarepo-logic/src/namespace.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/namespace.rs rename to mediarepo-daemon/mediarepo-logic/src/namespace.rs diff --git a/mediarepo-daemon/mediarepo-model/src/repo.rs b/mediarepo-daemon/mediarepo-logic/src/repo.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/repo.rs rename to mediarepo-daemon/mediarepo-logic/src/repo.rs diff --git a/mediarepo-daemon/mediarepo-model/src/tag.rs b/mediarepo-daemon/mediarepo-logic/src/tag.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/tag.rs rename to mediarepo-daemon/mediarepo-logic/src/tag.rs diff --git a/mediarepo-daemon/mediarepo-model/src/thumbnail.rs b/mediarepo-daemon/mediarepo-logic/src/thumbnail.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/thumbnail.rs rename to mediarepo-daemon/mediarepo-logic/src/thumbnail.rs diff --git a/mediarepo-daemon/mediarepo-model/src/type_keys.rs b/mediarepo-daemon/mediarepo-logic/src/type_keys.rs similarity index 100% rename from mediarepo-daemon/mediarepo-model/src/type_keys.rs rename to mediarepo-daemon/mediarepo-logic/src/type_keys.rs diff --git a/mediarepo-daemon/mediarepo-socket/Cargo.toml b/mediarepo-daemon/mediarepo-socket/Cargo.toml index a804747..c1f51ee 100644 --- a/mediarepo-daemon/mediarepo-socket/Cargo.toml +++ b/mediarepo-daemon/mediarepo-socket/Cargo.toml @@ -19,8 +19,8 @@ path = "../mediarepo-core" [dependencies.mediarepo-database] path = "../mediarepo-database" -[dependencies.mediarepo-model] -path = "../mediarepo-model" +[dependencies.mediarepo-logic] +path = "../mediarepo-logic" [dependencies.tokio] version = "^1.15.0" diff --git a/mediarepo-daemon/mediarepo-socket/src/from_model.rs b/mediarepo-daemon/mediarepo-socket/src/from_model.rs index dc0f59f..abec320 100644 --- a/mediarepo-daemon/mediarepo-socket/src/from_model.rs +++ b/mediarepo-daemon/mediarepo-socket/src/from_model.rs @@ -2,11 +2,11 @@ use mediarepo_core::mediarepo_api::types::files::{ FileBasicDataResponse, FileMetadataResponse, FileStatus, ThumbnailMetadataResponse, }; use mediarepo_core::mediarepo_api::types::tags::{NamespaceResponse, TagResponse}; -use mediarepo_model::file::{File, FileStatus as FileStatusModel}; -use mediarepo_model::file_metadata::FileMetadata; -use mediarepo_model::namespace::Namespace; -use mediarepo_model::tag::Tag; -use mediarepo_model::thumbnail::Thumbnail; +use mediarepo_logic::file::{File, FileStatus as FileStatusModel}; +use mediarepo_logic::file_metadata::FileMetadata; +use mediarepo_logic::namespace::Namespace; +use mediarepo_logic::tag::Tag; +use mediarepo_logic::thumbnail::Thumbnail; pub trait FromModel { fn from_model(model: M) -> Self; diff --git a/mediarepo-daemon/mediarepo-socket/src/lib.rs b/mediarepo-daemon/mediarepo-socket/src/lib.rs index 50f6918..a2e40cb 100644 --- a/mediarepo-daemon/mediarepo-socket/src/lib.rs +++ b/mediarepo-daemon/mediarepo-socket/src/lib.rs @@ -4,8 +4,8 @@ use mediarepo_core::mediarepo_api::types::misc::InfoResponse; use mediarepo_core::settings::{PortSetting, Settings}; use mediarepo_core::tokio_graceful_shutdown::SubsystemHandle; use mediarepo_core::type_keys::{RepoPathKey, SettingsKey, SizeMetadataKey, SubsystemKey}; -use mediarepo_model::repo::Repo; -use mediarepo_model::type_keys::RepoKey; +use mediarepo_logic::repo::Repo; +use mediarepo_logic::type_keys::RepoKey; use std::net::SocketAddr; use std::path::PathBuf; use std::sync::Arc; diff --git a/mediarepo-daemon/mediarepo-socket/src/namespaces/files/searching.rs b/mediarepo-daemon/mediarepo-socket/src/namespaces/files/searching.rs index e15c6df..3c04c8b 100644 --- a/mediarepo-daemon/mediarepo-socket/src/namespaces/files/searching.rs +++ b/mediarepo-daemon/mediarepo-socket/src/namespaces/files/searching.rs @@ -4,10 +4,10 @@ use mediarepo_core::mediarepo_api::types::files::FileStatus as ApiFileStatus; use mediarepo_core::mediarepo_api::types::filtering::{ FilterExpression, FilterQuery, PropertyQuery, TagQuery, ValueComparator, }; -use mediarepo_model::file::filter::NegatableComparator::{Is, IsNot}; -use mediarepo_model::file::filter::{FilterFileProperty, FilterProperty, OrderingComparator}; -use mediarepo_model::file::{File, FileStatus}; -use mediarepo_model::repo::Repo; +use mediarepo_logic::file::filter::NegatableComparator::{Is, IsNot}; +use mediarepo_logic::file::filter::{FilterFileProperty, FilterProperty, OrderingComparator}; +use mediarepo_logic::file::{File, FileStatus}; +use mediarepo_logic::repo::Repo; use std::collections::HashMap; #[tracing::instrument(level = "debug", skip(repo))] diff --git a/mediarepo-daemon/mediarepo-socket/src/namespaces/files/sorting.rs b/mediarepo-daemon/mediarepo-socket/src/namespaces/files/sorting.rs index 1f36770..6d6fed8 100644 --- a/mediarepo-daemon/mediarepo-socket/src/namespaces/files/sorting.rs +++ b/mediarepo-daemon/mediarepo-socket/src/namespaces/files/sorting.rs @@ -5,9 +5,9 @@ use mediarepo_core::mediarepo_api::types::filtering::{SortDirection, SortKey}; use mediarepo_database::queries::tags::{ get_cids_with_namespaced_tags, get_content_descriptors_with_tag_count, }; -use mediarepo_model::file::File; -use mediarepo_model::file_metadata::FileMetadata; -use mediarepo_model::repo::Repo; +use mediarepo_logic::file::File; +use mediarepo_logic::file_metadata::FileMetadata; +use mediarepo_logic::repo::Repo; use rayon::iter::{IntoParallelRefIterator, ParallelIterator}; use std::cmp::Ordering; use std::collections::HashMap; diff --git a/mediarepo-daemon/mediarepo-socket/src/utils.rs b/mediarepo-daemon/mediarepo-socket/src/utils.rs index 6c07756..568bf51 100644 --- a/mediarepo-daemon/mediarepo-socket/src/utils.rs +++ b/mediarepo-daemon/mediarepo-socket/src/utils.rs @@ -5,9 +5,9 @@ use mediarepo_core::mediarepo_api::types::identifier::FileIdentifier; use mediarepo_core::mediarepo_api::types::repo::SizeType; use mediarepo_core::type_keys::{RepoPathKey, SettingsKey}; use mediarepo_core::utils::get_folder_size; -use mediarepo_model::file::File; -use mediarepo_model::repo::Repo; -use mediarepo_model::type_keys::RepoKey; +use mediarepo_logic::file::File; +use mediarepo_logic::repo::Repo; +use mediarepo_logic::type_keys::RepoKey; use std::sync::Arc; use tokio::fs; diff --git a/mediarepo-daemon/src/main.rs b/mediarepo-daemon/src/main.rs index 3e60d09..4d615d4 100644 --- a/mediarepo-daemon/src/main.rs +++ b/mediarepo-daemon/src/main.rs @@ -9,7 +9,7 @@ use mediarepo_core::error::RepoResult; use mediarepo_core::fs::drop_file::DropFile; use mediarepo_core::settings::{PathSettings, Settings}; use mediarepo_core::tokio_graceful_shutdown::{SubsystemHandle, Toplevel}; -use mediarepo_model::repo::Repo; +use mediarepo_logic::repo::Repo; use mediarepo_socket::start_tcp_server; use std::env; use std::time::Duration; diff --git a/mediarepo-daemon/src/utils.rs b/mediarepo-daemon/src/utils.rs index 2abb7e1..cf9cf4b 100644 --- a/mediarepo-daemon/src/utils.rs +++ b/mediarepo-daemon/src/utils.rs @@ -1,7 +1,7 @@ use mediarepo_core::error::RepoResult; use mediarepo_core::settings::v1::SettingsV1; use mediarepo_core::settings::{PathSettings, Settings}; -use mediarepo_model::repo::Repo; +use mediarepo_logic::repo::Repo; use std::path::PathBuf; use tokio::fs;