Skip to content

Commit

Permalink
Axum routes migration (#577)
Browse files Browse the repository at this point in the history
* Migrate dashboard routes to Axum

* Migrate tv/season/episode routes to Axum

* Migrate filebrowser routes to Axum

* Do not attempt to extract user in TV routes where it is unused

* Library routes moved to be within auth middleware

* Migrate search route to Axum

* Migrate settings routes to Axum

* Migrate mediafile routes to Axum

* Migrate user routes to Axum

* Migrate media routes to Axum

* Move media_routes within Axum auth middleware

* Cleanup imports and move to displaydoc
  • Loading branch information
niamu authored Nov 21, 2023
1 parent 9cc3704 commit af6df1c
Show file tree
Hide file tree
Showing 29 changed files with 1,472 additions and 2,526 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion dim-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ serde_derive = "^1.0.125"
serde_json = "^1.0.64"

async-trait = "0.1.50"
bytes = "1.0.1"
cfg-if = "1.0.0"
chrono = { version = "0.4.19", features = ["serde"] }
dia-i18n = "0.10.0"
Expand Down
5 changes: 0 additions & 5 deletions dim-core/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use thiserror::Error;
use serde::Serialize;
use serde_json::json;

use crate::routes::mediafile;
use nightfall::error::NightfallError;

use http::StatusCode;
Expand Down Expand Up @@ -57,9 +56,6 @@ pub enum DimError {
UsernameNotAvailable,
/// An error has occured while parsing cookies: {0:?}
CookieError(#[source] dim_auth::AuthError),
/// Error occured in the `/api/v1/mediafile` routes.
#[error(transparent)]
MediafileRouteError(#[from] mediafile::Error),
/// User does not exist
UserNotFound,
/// Couldn't find the tmdb id provided.
Expand Down Expand Up @@ -121,7 +117,6 @@ impl warp::Reply for DimError {
Self::UnsupportedFile | Self::InvalidMediaType | Self::MissingFieldInBody { .. } => {
StatusCode::NOT_ACCEPTABLE
}
Self::MediafileRouteError(ref e) => e.status_code(),
};

let resp = json!({
Expand Down
1 change: 0 additions & 1 deletion dim-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use tracing_subscriber::EnvFilter;

/// Various utilities
pub mod utils;
pub(crate) use utils::json;

/// Module contains our core initialization logic.
pub mod core;
Expand Down
203 changes: 0 additions & 203 deletions dim-core/src/routes/auth.rs

This file was deleted.

Loading

0 comments on commit af6df1c

Please sign in to comment.