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

[WIP] Add TMDB support #1082

Draft
wants to merge 139 commits into
base: master
Choose a base branch
from
Draft

[WIP] Add TMDB support #1082

wants to merge 139 commits into from

Conversation

revam
Copy link
Member

@revam revam commented Aug 20, 2023

No description provided.

dotnet_naming_style.instance_field_style.capitalization = camel_case
dotnet_naming_style.instance_field_style.required_prefix = _
dotnet_naming_style.instance_field_style.capitalization = pascal_case
dotnet_naming_style.instance_field_style.required_prefix =
Copy link
Member

Choose a reason for hiding this comment

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

What's happened here?

Copy link
Member

Choose a reason for hiding this comment

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

Indeed. No pascal case

Copy link
Member Author

Choose a reason for hiding this comment

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

I changed it to get the IDE to shut up about it's "suggestions" to rename the fields. My IDE was suggesting to renaming all properties to use camel case and a prefix. If you can somehow tweak the rules to only apply the prefix and camel case to the private properties, then be my guest, i won't invest time into finding the correct settings to use atm.

Copy link
Member Author

Choose a reason for hiding this comment

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

And yes, I can remove the commit that changed these settings from this PR, but it's staying for now, so i can keep my sanity… for now.

"UNK" => TitleLanguage.Unknown,
_ => TitleLanguage.Unknown,
"UR" or "URD" => TitleLanguage.Urdu,
"GREEK (ANCIENT)" => TitleLanguage.Greek,
Copy link
Member

Choose a reason for hiding this comment

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

What's all this? The format changed entirely

/// <returns>200 on found, 400/404 if the type or source are invalid, and 404 if the id is not found</returns>
[HttpGet("{source}/{type}/{value}")]
[ProducesResponseType(typeof(FileStreamResult), 200)]
[ProducesResponseType(404)]
public ActionResult GetImage([FromRoute] Image.ImageSource source, [FromRoute] Image.ImageType type,
[FromRoute] string value)
[FromRoute] int value)
Copy link
Member

Choose a reason for hiding this comment

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

This looks like a breaking change. Please comment

Copy link
Member Author

Choose a reason for hiding this comment

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

Theoretically breaking, practically not so much. We never used the "static" images in v3, since all the images the web ui needs are shipped with the web ui, so having the id as a stringified int 100% of the time made no sense (to me at least). I could had made this change to master instead of in this PR, yes.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also, the way we use the image metadata in the web ui makes it so this change won't break the web ui. Shokofin might break, but I can fix that in the "unstable" channel if it does break it.

Copy link
Member Author

@revam revam Aug 28, 2023

Choose a reason for hiding this comment

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

Looking at @harshithmohan's v3 branch for Metadata, then it doesn't look like it will break since it's just using the JSON values as-is without any type checking (which is done in Shokofin, since it's C#).

https://github.com/harshithmohan/ShokoMetadata.bundle/blob/apiv3/Contents/Code/__init__.py#L481

@revam revam force-pushed the tmdb-2 branch 4 times, most recently from b0981b1 to 6a53308 Compare September 6, 2023 22:20
and also fix the missing debug messages…
though the logic to purge them is still missing and will be added soon™.
just a few tweaks here and there, and also fix "unlinking" an episode
by setting the tmdb id to 0 (which was disallowed in the api). setting
the id to 0 instead of deleting the mapping for the shoko/anidb episode
will prevent the auto-matching logic to re-adding new links for the
shoko/anidb episode as long as we don't specify we want to remove all
existing links.
this should ensure we don't have any unused entries remaining,
including any sub-entries related to the entry.
- add base cast/crew models, and cast/crew models for show/season,
  and hook them all up internally.

- add methods to get the show networks internally

- add aliases to the person model to-be exposed in the api layer later.
for the database. which is still not done.
- add an include query parameter to get partial data for
  an entry. and an accompanying endpoint to get the same data.

- rename "Fanarts" to "Backdrops" for the "Images" model

- Add cast to api

- Add crew to api

- Add networks to api

- Add show/movie cross-reference to api

- Split up online/offline search, but don't implement either yet.

- Misc other changes
since I need _something_ to test this out with.
Add TMDB Movie/Episode Cross-references for Shoko Episodes,
and also add the missing description for the two other endpoints
to get the TMDB Movies/Episodes.
Add TMDB Movie/Show Cross-references for Shoko Series,
and also tweak the Shoko Episode Cross-references for the Shoko Series
to allow previewing matches for non-linked shows that are locally
available, and split up the linking and scheduling an update for both
shows and movies.
I won't even be ars*d to write them out.
for tv shows before falling back to offline search if online fails.
since it wasn't as useful as i thought it would be.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants