Enhance movie import process and metadata handling
ci / build-backend (push) Successful in 1m33s
ci / build-frontend (push) Successful in 55s
ci / tests (push) Successful in 3m27s
ci / sonar (push) Successful in 6m55s

Refactored the movie import functionality to ensure that the title from the source is used for the show name, while the file name is retained as the original title. Improved the handling of metadata during the import process, allowing for better integration of original titles from various sources. Updated related classes and methods to streamline the import workflow and enhance user experience. Added tests to verify the correct assignment of titles and original names during the import process. Updated documentation to reflect these changes.
This commit is contained in:
Leonid Pershin
2026-07-28 03:14:19 +03:00
parent d859a9894c
commit d0bc0465e7
21 changed files with 926 additions and 698 deletions
@@ -63,7 +63,8 @@ public sealed class TmdbMetadataProvider(
YearFrom(GetString(item, DateField(movie))),
GetString(item, "overview"),
PosterUrl(GetString(item, "poster_path")),
movie ? ShowKind.Single : ShowKind.Series
movie ? ShowKind.Single : ShowKind.Series,
GetString(item, OriginalTitleField(movie))
)
);
}
@@ -83,6 +84,9 @@ public sealed class TmdbMetadataProvider(
private static string DateField(bool movie) => movie ? "release_date" : "first_air_date";
private static string OriginalTitleField(bool movie) =>
movie ? "original_title" : "original_name";
public async Task<ShowMetadata?> GetShowAsync(
string externalId,
ShowKind kind,
@@ -108,7 +112,8 @@ public sealed class TmdbMetadataProvider(
PosterUrl(GetString(root, "poster_path")),
GenresFrom(root),
movie ? MovieCertification(root) : TvCertification(root),
FranchiseFrom(root)
FranchiseFrom(root),
GetString(root, OriginalTitleField(movie))
);
}