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

Add library/<id>/scan to force a scan and metadata update capability for current scanner. #401

Closed
wants to merge 13 commits into from

Conversation

mental32
Copy link
Collaborator

No description provided.

dim/src/routes/library.rs Outdated Show resolved Hide resolved
dim/src/scanners/base.rs Outdated Show resolved Hide resolved
dim/src/scanners/scanner_daemon.rs Outdated Show resolved Hide resolved
@mental32
Copy link
Collaborator Author

@vgarleanu there seems to be some CI error for downloading ffmpeg stuff

@vgarleanu
Copy link
Member

@vgarleanu there seems to be some CI error for downloading ffmpeg stuff

Yeah known issue, working on it...

dim/src/scanners/base.rs Outdated Show resolved Hide resolved
@mental32 mental32 changed the title expose a library scan route and make scanner handle media updates better Add library/<id>/scan to force a scan and metadata update capability for current scanner. Feb 13, 2022
@mental32 mental32 marked this pull request as ready for review February 13, 2022 18:10
dim/src/scanners/base.rs Outdated Show resolved Hide resolved
dim/src/scanners/base.rs Outdated Show resolved Hide resolved
@@ -270,6 +288,19 @@ pub async fn get_self(
Ok(reply::json(&Library::get_one(&mut tx, id).await?))
}

/// # POST `/api/v1/library/<id>/scan`
/// This method will scan the provided library, updating the metadata for pre-existing media entries.
///
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mssing docs

media_id,
library_id,
target_file,
raw_name: media_file.raw_name,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why aren't we updating the raw name to the media's name?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking it might be cleaner to just update the media file with the correct name and year so that the flow below won't error out if it doesn't find a correct result in tmdb.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a file is matched already, we might want to set its raw_name and raw_year to its parent media's name and year. This way later down this flow, we dont have to lookup the parent of a mediafile always. We might also want to set the raw_episode and raw_season for a mediafile to the episode and season of its parent if its parent is an episode.

library_id,
target_file,
raw_name: media_file.raw_name,
raw_year: raw_year.or(media_file.raw_year),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@vgarleanu
Copy link
Member

Closing as this PR is superseded by #447

@vgarleanu vgarleanu closed this Jun 26, 2022
@vgarleanu vgarleanu deleted the 113-scan-route branch June 26, 2022 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants