Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✏️ Run cspell to correct spelling errors #496

Merged
merged 2 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Things you can expect to see afterwards:
- 🖥️ Cross-platform desktop app _(Windows, Mac, Linux)_
- 📖 [Tachiyomi](https://github.com/stumpapp/tachiyomi-extensions) support
- 📱 In-house mobile app _(Android, iOS)_
- 🔎 Versitile full-text search _(blocked by [prisma#9414](https://github.com/prisma/prisma/issues/9414))_
- 🔎 Versatile full-text search _(blocked by [prisma#9414](https://github.com/prisma/prisma/issues/9414))_
- 👥 Configurable book clubs _(see [this issue](https://github.com/stumpapp/stump/issues/120))_

Feel free to reach out if you have anything else you'd like to see!
Expand Down
38 changes: 19 additions & 19 deletions apps/desktop/src-tauri/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use crate::{

/// An error type for the desktop RPC commands.
#[derive(Debug, Serialize, thiserror::Error)]
pub enum DeskopRPCError {
pub enum DesktopRPCError {
JMicheli marked this conversation as resolved.
Show resolved Hide resolved
#[error("Failed to get state in handler")]
MutexPoisoned,
#[error("{0}")]
Expand All @@ -24,7 +24,7 @@ pub enum DeskopRPCError {
StoreError(#[from] StoreError),
}

impl From<SecureStoreError> for DeskopRPCError {
impl From<SecureStoreError> for DesktopRPCError {
fn from(error: SecureStoreError) -> Self {
Self::CredentialsError(error.to_string())
}
Expand All @@ -34,8 +34,8 @@ impl From<SecureStoreError> for DeskopRPCError {
pub fn set_use_discord_connection(
connect: bool,
ctx: State<WrappedState>,
) -> Result<(), DeskopRPCError> {
let mut state = ctx.lock().map_err(|_| DeskopRPCError::MutexPoisoned)?;
) -> Result<(), DesktopRPCError> {
let mut state = ctx.lock().map_err(|_| DesktopRPCError::MutexPoisoned)?;
let discord_client = &mut state.discord_client;

if connect {
Expand All @@ -53,8 +53,8 @@ pub fn set_discord_presence(
status: Option<String>,
details: Option<String>,
state: State<WrappedState>,
) -> Result<(), DeskopRPCError> {
let mut state = state.lock().map_err(|_| DeskopRPCError::MutexPoisoned)?;
) -> Result<(), DesktopRPCError> {
let mut state = state.lock().map_err(|_| DesktopRPCError::MutexPoisoned)?;
let discord_client = &mut state.discord_client;

if discord_client.is_connected() {
Expand All @@ -67,7 +67,7 @@ pub fn set_discord_presence(
#[tauri::command]
pub async fn get_current_server(
app_handle: AppHandle,
) -> Result<Option<String>, DeskopRPCError> {
) -> Result<Option<String>, DesktopRPCError> {
let store = AppStore::load_store(&app_handle)?;
let server = store.get_active_server();
Ok(server.map(|s| s.name))
Expand All @@ -77,8 +77,8 @@ pub async fn get_current_server(
pub async fn init_credential_store(
state: State<'_, WrappedState>,
app_handle: AppHandle,
) -> Result<(), DeskopRPCError> {
let mut state = state.lock().map_err(|_| DeskopRPCError::MutexPoisoned)?;
) -> Result<(), DesktopRPCError> {
let mut state = state.lock().map_err(|_| DesktopRPCError::MutexPoisoned)?;
let store = AppStore::load_store(&app_handle)?;

let servers = store.get_servers();
Expand All @@ -93,17 +93,17 @@ pub async fn init_credential_store(
#[tauri::command]
pub async fn get_credential_store_state(
state: State<'_, WrappedState>,
) -> Result<CredentialStoreTokenState, DeskopRPCError> {
let state = state.lock().map_err(|_| DeskopRPCError::MutexPoisoned)?;
) -> Result<CredentialStoreTokenState, DesktopRPCError> {
let state = state.lock().map_err(|_| DesktopRPCError::MutexPoisoned)?;
Ok(state.secure_store.get_login_state())
}

#[tauri::command]
pub async fn get_api_token(
server: String,
state: State<'_, WrappedState>,
) -> Result<Option<String>, DeskopRPCError> {
let state = state.lock().map_err(|_| DeskopRPCError::MutexPoisoned)?;
) -> Result<Option<String>, DesktopRPCError> {
let state = state.lock().map_err(|_| DesktopRPCError::MutexPoisoned)?;

let token = state.secure_store.get_api_token(server)?;

Expand All @@ -115,8 +115,8 @@ pub async fn set_api_token(
server: String,
token: String,
state: State<'_, WrappedState>,
) -> Result<(), DeskopRPCError> {
let state = state.lock().map_err(|_| DeskopRPCError::MutexPoisoned)?;
) -> Result<(), DesktopRPCError> {
let state = state.lock().map_err(|_| DesktopRPCError::MutexPoisoned)?;

state.secure_store.set_api_token(server, token)?;

Expand All @@ -127,16 +127,16 @@ pub async fn set_api_token(
pub async fn delete_api_token(
server: String,
state: State<'_, WrappedState>,
) -> Result<bool, DeskopRPCError> {
let state = state.lock().map_err(|_| DeskopRPCError::MutexPoisoned)?;
) -> Result<bool, DesktopRPCError> {
let state = state.lock().map_err(|_| DesktopRPCError::MutexPoisoned)?;
Ok(state.secure_store.delete_api_token(server)?)
}

#[tauri::command]
pub async fn clear_credential_store(
state: State<'_, WrappedState>,
) -> Result<(), DeskopRPCError> {
let mut state = state.lock().map_err(|_| DeskopRPCError::MutexPoisoned)?;
) -> Result<(), DesktopRPCError> {
let mut state = state.lock().map_err(|_| DesktopRPCError::MutexPoisoned)?;
state.secure_store.clear();
Ok(())
}
4 changes: 2 additions & 2 deletions apps/desktop/src-tauri/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#![allow(clippy::enum_variant_names)]

use crate::{
commands::DeskopRPCError, store::StoreError, utils::discord::DiscordIntegrationError,
commands::DesktopRPCError, store::StoreError, utils::discord::DiscordIntegrationError,
};

#[derive(Debug, thiserror::Error)]
pub enum DesktopError {
#[error("{0}")]
RPCError(#[from] DeskopRPCError),
RPCError(#[from] DesktopRPCError),
#[error("{0}")]
DiscordError(#[from] DiscordIntegrationError),
#[error("{0}")]
Expand Down
2 changes: 1 addition & 1 deletion apps/expo/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function AppWrapper() {
}, [error, setIsConnectedToServer])

useEffect(() => {
// TODO: ios vs androind?
// TODO: ios vs android?
setPlatform('mobile')
}, [setPlatform])

Expand Down
2 changes: 1 addition & 1 deletion apps/expo/src/components/reader/epub/LoadingSpinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function LoadingSpinner({
// downloadError,
downloadSuccess,
}: LoadingFileProps) {
// Setup a timeout that will check if we are stuck loading, abougt 10 seconds
// Setup a timeout that will check if we are stuck loading, about 10 seconds
const [didTimeout, setDidTimeout] = useState(false)

// If we are still loading after 10 seconds, we are stuck
Expand Down
4 changes: 2 additions & 2 deletions apps/expo/src/components/reader/image/ImageBasedReader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type ImageDimension = {
}

// TODO: This is an image-based reader right now. Extract this to a separate component
// which is readered when the book is an image-based book.
// which is rendered when the book is an image-based book.

// TODO: Account for device orientation AND reading direction

Expand Down Expand Up @@ -55,7 +55,7 @@ export default function ImageBasedReader({ book, initialPage, incognito }: Props

const deviceOrientation = width > height ? 'landscape' : 'portrait'

// TODO: an effect that whenever the device orienation changes to something different than before,
// TODO: an effect that whenever the device orientation changes to something different than before,
// recalculate the ratios of the images? Maybe. Who knows, you will though

const { updateReadProgressAsync } = useUpdateMediaProgress(book.id)
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/config/cors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

// Format the local IP with both http and https, and the port. If is_debug is true,
// then also add port 3000.
let local_orgins = if local_ip.is_empty() {
let local_origins = if local_ip.is_empty() {

Check warning on line 54 in apps/server/src/config/cors.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/config/cors.rs#L54

Added line #L54 was not covered by tests
vec![]
} else {
let port = config.port;
Expand All @@ -77,7 +77,7 @@
} else {
DEFAULT_ALLOWED_ORIGINS
};
let default_allowlist = merge_origins(defaults, local_orgins);
let default_allowlist = merge_origins(defaults, local_origins);

Check warning on line 80 in apps/server/src/config/cors.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/config/cors.rs#L80

Added line #L80 was not covered by tests

// TODO: add new config option for fully overriding the default allowlist versus appending to it
cors_layer = cors_layer.allow_origin(AllowOrigin::list(
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/filter/basic_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub struct UserQueryRelation {

// TODO: decide what others to include
#[derive(Default, Debug, Clone, Deserialize, Serialize, ToSchema, Type)]
pub struct SeriesMedataFilter {
pub struct SeriesMetadataFilter {
#[serde(default, deserialize_with = "string_or_seq_string")]
pub meta_type: Vec<String>,
#[serde(default, deserialize_with = "string_or_seq_string")]
Expand Down Expand Up @@ -198,7 +198,7 @@ pub struct SeriesBaseFilter {
pub search: Option<String>,

#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<SeriesMedataFilter>,
pub metadata: Option<SeriesMetadataFilter>,
}

#[derive(Default, Debug, Clone, Deserialize, Serialize, ToSchema, Type)]
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/filter/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ where
deserializer.deserialize_any(ReadStatusOrVec(PhantomData))
}

// See https://github.com/nox/serde_urlencoded/issues/26 and the workaroud solution
// See https://github.com/nox/serde_urlencoded/issues/26 and the workaround solution
// https://docs.rs/serde_qs/0.6.1/serde_qs/#flatten-workaround
// TLDR; there are issues deserializing flattened structs, esp with nested enums.
pub fn from_optional_str<'de, D, S>(deserializer: D) -> Result<Option<S>, D::Error>
Expand Down
8 changes: 4 additions & 4 deletions apps/server/src/middleware/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ async fn handle_basic_auth(
} else if is_match {
tracing::trace!(
username = &user.username,
"Basic authentication sucessful. Creating session for user"
"Basic authentication successful. Creating session for user"
);
enforce_max_sessions(&user, client).await?;
let user = User::from(user);
Expand Down Expand Up @@ -352,10 +352,10 @@ impl IntoResponse for OPDSBasicAuth {
return APIError::InternalServerError(e.to_string()).into_response();
},
};
let json_repsonse = Json(document).into_response();
let body = json_repsonse.into_body();
let json_response = Json(document).into_response();
let body = json_response.into_body();

// We want to ecourage the client to delete any existing session cookies when the current
// We want to encourage the client to delete any existing session cookies when the current
// is no longer valid
let delete_cookie = delete_cookie_header();

Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/routers/api/filters/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::{
filter::{
chain_optional_iter, MediaMetadataBaseFilter, MediaMetadataFilter,
MediaMetadataRelationFilter, SeriesMedataFilter, ValueOrRange,
MediaMetadataRelationFilter, SeriesMetadataFilter, ValueOrRange,
},
routers::api::filters::apply_media_filters,
};
Expand Down Expand Up @@ -96,7 +96,7 @@
}

pub(crate) fn apply_series_metadata_filters(
filters: SeriesMedataFilter,
filters: SeriesMetadataFilter,

Check warning on line 99 in apps/server/src/routers/api/filters/metadata.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/api/filters/metadata.rs#L99

Added line #L99 was not covered by tests
) -> Vec<series_metadata::WhereParam> {
chain_optional_iter(
[],
Expand Down
6 changes: 4 additions & 2 deletions apps/server/src/routers/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
LibraryBaseFilter, LibraryFilter, LibraryRelationFilter, LogFilter,
MediaBaseFilter, MediaFilter, MediaMetadataBaseFilter, MediaMetadataFilter,
MediaMetadataRelationFilter, Range, ReadStatus, SeriesBaseFilter,
SeriesFilter, SeriesMedataFilter, SeriesQueryRelation, UserQueryRelation,
SeriesFilter, SeriesMetadataFilter, SeriesQueryRelation, UserQueryRelation,
ValueOrRange,
},
routers::api::v1::{
Expand Down Expand Up @@ -152,7 +152,9 @@
file.write_all(format!("{}\n\n", ts_export::<MediaFilter>()?).as_bytes())?;
file.write_all(format!("{}\n\n", ts_export::<BookRelations>()?).as_bytes())?;
file.write_all(format!("{}\n\n", ts_export::<SeriesBaseFilter>()?).as_bytes())?;
file.write_all(format!("{}\n\n", ts_export::<SeriesMedataFilter>()?).as_bytes())?;
file.write_all(
format!("{}\n\n", ts_export::<SeriesMetadataFilter>()?).as_bytes(),
)?;

Check warning on line 157 in apps/server/src/routers/api/mod.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/api/mod.rs#L155-L157

Added lines #L155 - L157 were not covered by tests
file.write_all(format!("{}\n\n", ts_export::<SeriesFilter>()?).as_bytes())?;
file.write_all(
format!("{}\n\n", ts_export::<ValueOrRange<String>>()?).as_bytes(),
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/routers/api/v1/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@

let client = state.db.clone();
let today: DateTime<FixedOffset> = Utc::now().into();
// TODO: make this configurable via environment variable so knowledgable attackers can't bypass this
// TODO: make this configurable via environment variable so knowledgeable attackers can't bypass this

Check warning on line 202 in apps/server/src/routers/api/v1/auth.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/api/v1/auth.rs#L202

Added line #L202 was not covered by tests
let twenty_four_hours_ago = today - Duration::hours(24);

let fetch_result = client
Expand Down Expand Up @@ -237,7 +237,7 @@
let user_id = db_user.id.clone();
let matches = verify_password(&db_user.hashed_password, &input.password)?;
if !matches {
// TODO: make this configurable via environment variable so knowledgable attackers can't bypass this
// TODO: make this configurable via environment variable so knowledgeable attackers can't bypass this
let should_lock_account = db_user
.login_activity
.as_ref()
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/routers/api/v1/book_club.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ use crate::{
// TODO: patch schedule
// TODO: check members can access the books in the schedule. I don't think lack of access should necessarily
// be an error, but it would definitely be a warning for admins/creator
// TODO: users that are members but have the feature revoked need some reconcilation...
// TODO: users that are members but have the feature revoked need some reconciliation...

// TODO: adjust the instrumentation once ret(err) is supported: https://github.com/tokio-rs/tracing/pull/2970

Expand Down Expand Up @@ -344,7 +344,7 @@ async fn update_book_club(
let viewer = req.user();

// Query first for access control. Realistically, I could `update_many` with the
// access assertions, but I would have to requery for the book afterwards anyways
// access assertions, but I would have to re-query for the book afterwards anyways
let book_club = client
.book_club()
.find_first(vec![
Expand Down
6 changes: 3 additions & 3 deletions apps/server/src/routers/api/v1/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

let genres = get_genres(&client, &where_conditions).await?;
let writers = get_writers(&client, &where_conditions).await?;
let pencillers = get_pencllers(&client, &where_conditions).await?;
let pencillers = get_pencillers(&client, &where_conditions).await?;

Check warning on line 101 in apps/server/src/routers/api/v1/metadata.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/api/v1/metadata.rs#L101

Added line #L101 was not covered by tests
let inkers = get_inkers(&client, &where_conditions).await?;
let colorists = get_colorists(&client, &where_conditions).await?;
let letterers = get_letterers(&client, &where_conditions).await?;
Expand Down Expand Up @@ -207,7 +207,7 @@
))
}

async fn get_pencllers(
async fn get_pencillers(

Check warning on line 210 in apps/server/src/routers/api/v1/metadata.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/api/v1/metadata.rs#L210

Added line #L210 was not covered by tests
client: &PrismaClient,
where_conditions: &[media_metadata::WhereParam],
) -> APIResult<Vec<String>> {
Expand Down Expand Up @@ -244,7 +244,7 @@
) -> APIResult<Json<Vec<String>>> {
let FilterableQuery { filters, .. } = filter_query.0.get();
Ok(Json(
get_pencllers(&ctx.db, &apply_media_metadata_filters(filters)).await?,
get_pencillers(&ctx.db, &apply_media_metadata_filters(filters)).await?,

Check warning on line 247 in apps/server/src/routers/api/v1/metadata.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/api/v1/metadata.rs#L247

Added line #L247 was not covered by tests
))
}

Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/routers/api/v1/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async fn ping() -> APIResult<String> {
#[derive(Serialize, Deserialize, Type, ToSchema)]
pub struct StumpVersion {
// TODO: add docker tag since special versions (e.g. nightly, experimental) will have the latest semver but a different commit
// Also will allow for the UI to display explcitly the docker tag if it's a special version
// Also will allow for the UI to display explicitly the docker tag if it's a special version
pub semver: String,
pub rev: String,
pub compile_time: String,
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/routers/api/v1/reading_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
) -> reading_list::WhereParam {
// A common condition that asserts there is a RBAC entry for the user that has a role
// greater than or equal to the minimum role:
// 1 for raeder, 2 for collaborator, 3 for creator
// 1 for reader, 2 for collaborator, 3 for creator

Check warning on line 51 in apps/server/src/routers/api/v1/reading_list.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/api/v1/reading_list.rs#L51

Added line #L51 was not covered by tests
let base_rbac = reading_list::access_control::some(vec![and![
reading_list_rbac::user_id::equals(user_id.clone()),
reading_list_rbac::role::gte(minimum_role),
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/routers/api/v1/smart_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@
let user = req.user_and_enforce_permissions(&[UserPermission::AccessSmartList])?;
let client = &ctx.db;

// NOTE: views are currently completely detatched from a user, rather they are tied
// NOTE: views are currently completely detached from a user, rather they are tied

Check warning on line 624 in apps/server/src/routers/api/v1/smart_list.rs

View check run for this annotation

Codecov / codecov/patch

apps/server/src/routers/api/v1/smart_list.rs#L624

Added line #L624 was not covered by tests
// only to the smart list. This makes _this_ aspect a bit awkward. For now, to not over
// complicate sharing and permissions, I will leave this as-is. But this can be a future
// improvement down the road.
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/routers/utoipa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ use super::api::{
MediaSmartFilter, MediaMetadataSmartFilter, SeriesSmartFilter, SeriesMetadataSmartFilter,
LibrarySmartFilter, Notifier, CreateOrUpdateNotifier, PatchNotifier, LibraryBaseFilter, LibraryRelationFilter,
MediaBaseFilter, MediaRelationFilter, SeriesBaseFilter, SeriesRelationFilter, NotifierConfig, NotifierType,
ReadingListItem, ReadingListVisibility, SeriesMedataFilter
ReadingListItem, ReadingListVisibility, SeriesMetadataFilter
)
),
tags(
Expand Down
2 changes: 1 addition & 1 deletion core/integration-tests/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct TempLibrary {
}

impl TempLibrary {
/// Creates the root temporary libray for the [`TempLibrary`] struct. Places it
/// Creates the root temporary library for the [`TempLibrary`] struct. Places it
/// as a child of CARGO_MANIFEST_DIR.
fn root() -> TempDir {
Builder::new()
Expand Down
Loading
Loading