Skip to content
Draft
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
6 changes: 6 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive

- name: Install system dependencies
run: sudo apt-get install -y mediainfo librhash-dev
Expand Down Expand Up @@ -58,6 +60,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive

- name: Install system dependencies
run: sudo apt-get install -y mediainfo librhash-dev
Expand Down Expand Up @@ -105,6 +109,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive

- name: Install system dependencies
run: sudo apt-get install -y mediainfo librhash-dev
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "ext/TMDbLib"]
path = ext/TMDbLib
url = https://github.com/jellyfin/TMDbLib.git
9 changes: 9 additions & 0 deletions Shoko.Server/API/v3/Models/TMDB/TmdbEpisode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ public class TmdbEpisode
/// </summary>
public TimeSpan? Runtime { get; init; }

/// <summary>
/// TMDB's own episode classification (<c>standard</c>, <c>finale</c>,
/// <c>mid_season</c>, <c>special</c>), verbatim from the API. <c>null</c>
/// until the episode has been refreshed since the field was added.
/// </summary>
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public string? TmdbEpisodeType { get; init; }

/// <summary>
/// All images stored locally for this episode, if any.
/// </summary>
Expand Down Expand Up @@ -204,6 +212,7 @@ public TmdbEpisode(TMDB_Show show, TMDB_Episode episode, TMDB_AlternateOrdering_
Source = "TMDB",
};
Runtime = episode.Runtime;
TmdbEpisodeType = episode.TmdbEpisodeType;
if (include.HasFlag(IncludeDetails.Images))
Images = ((IWithImages)episode).GetImages()
.InLanguage(language)
Expand Down
1 change: 1 addition & 0 deletions Shoko.Server/Databases/MySQL.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,7 @@ WHERE sri.`CrossReferences` LIKE '%AnidbEpisodeID%'
new(187, 39, "CREATE INDEX `IX_CrossRef_AniDB_Anilist_Episode_AnilistEpisodeID` ON `CrossRef_AniDB_Anilist_Episode`(`AnilistEpisodeID`);"),
new(187, 40, "CREATE TABLE `Anilist_Anime_ExternalLink` ( `Anilist_Anime_ExternalLinkID` INT NOT NULL AUTO_INCREMENT, `AnilistAnimeID` INT NOT NULL, `AnilistLinkID` INT NOT NULL, `Url` VARCHAR(512) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `Site` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `AnilistSiteID` INT NULL, `LinkType` VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, `LanguageCode` VARCHAR(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL, PRIMARY KEY (`Anilist_Anime_ExternalLinkID`) );"),
new(187, 41, "CREATE INDEX `IX_Anilist_Anime_ExternalLink_AnilistAnimeID` ON `Anilist_Anime_ExternalLink`(`AnilistAnimeID`);"),
new(188, 1, "ALTER TABLE `TMDB_Episode` ADD COLUMN `TmdbEpisodeType` VARCHAR(50) NULL DEFAULT NULL;"),
];

#endregion
Expand Down
1 change: 1 addition & 0 deletions Shoko.Server/Databases/SQLServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1189,6 +1189,7 @@ WHERE sri.CrossReferences LIKE '%AnidbEpisodeID%'
new(185, 39, "CREATE INDEX IX_CrossRef_AniDB_Anilist_Episode_AnilistEpisodeID ON CrossRef_AniDB_Anilist_Episode(AnilistEpisodeID);"),
new(185, 40, "CREATE TABLE Anilist_Anime_ExternalLink ( Anilist_Anime_ExternalLinkID INT IDENTITY(1,1) NOT NULL, AnilistAnimeID INT NOT NULL, AnilistLinkID INT NOT NULL, Url NVARCHAR(512) NOT NULL, Site NVARCHAR(128) NOT NULL, AnilistSiteID INT NULL, LinkType NVARCHAR(32) NOT NULL, LanguageCode NVARCHAR(32) NULL, CONSTRAINT PK_Anilist_Anime_ExternalLink PRIMARY KEY CLUSTERED (Anilist_Anime_ExternalLinkID) );"),
new(185, 41, "CREATE INDEX IX_Anilist_Anime_ExternalLink_AnilistAnimeID ON Anilist_Anime_ExternalLink(AnilistAnimeID);"),
new(186, 1, "ALTER TABLE TMDB_Episode ADD TmdbEpisodeType NVARCHAR(50) NULL DEFAULT NULL;"),
];

#endregion
Expand Down
1 change: 1 addition & 0 deletions Shoko.Server/Databases/SQLite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ WHERE CrossReferences LIKE '%AnidbEpisodeID%'
new(166, 39, "CREATE INDEX IX_CrossRef_AniDB_Anilist_Episode_AnilistEpisodeID ON CrossRef_AniDB_Anilist_Episode(AnilistEpisodeID);"),
new(166, 40, "CREATE TABLE Anilist_Anime_ExternalLink ( Anilist_Anime_ExternalLinkID INTEGER PRIMARY KEY AUTOINCREMENT, AnilistAnimeID INTEGER NOT NULL, AnilistLinkID INTEGER NOT NULL, Url TEXT NOT NULL, Site TEXT NOT NULL, AnilistSiteID INTEGER NULL, LinkType TEXT NOT NULL, LanguageCode TEXT NULL );"),
new(166, 41, "CREATE INDEX IX_Anilist_Anime_ExternalLink_AnilistAnimeID ON Anilist_Anime_ExternalLink(AnilistAnimeID);"),
new(167, 1, "ALTER TABLE TMDB_Episode ADD COLUMN TmdbEpisodeType TEXT NULL DEFAULT NULL;"),
];

#endregion
Expand Down
1 change: 1 addition & 0 deletions Shoko.Server/Mappings/TMDB/TMDB_EpisodeMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public TMDB_EpisodeMap()
Map(x => x.SeasonNumber).Not.Nullable();
Map(x => x.EpisodeNumber).Not.Nullable();
Map(x => x.RuntimeMinutes).Column("Runtime");
Map(x => x.TmdbEpisodeType).Nullable();
Map(x => x.UserRating).Not.Nullable();
Map(x => x.UserVotes).Not.Nullable();
Map(x => x.AiredAt).CustomType<DateOnlyConverter>();
Expand Down
10 changes: 9 additions & 1 deletion Shoko.Server/Models/TMDB/TMDB_Episode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
using Shoko.Server.Providers.TMDB;
using Shoko.Server.Repositories;
using Shoko.Server.Utilities;
using TMDbLib.Objects.General;

Check failure on line 21 in Shoko.Server/Models/TMDB/TMDB_Episode.cs

View workflow job for this annotation

GitHub Actions / Unit Tests

The type or namespace name 'TMDbLib' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 21 in Shoko.Server/Models/TMDB/TMDB_Episode.cs

View workflow job for this annotation

GitHub Actions / Schema Parity — SQLite vs MySQL vs SQL Server

The type or namespace name 'TMDbLib' could not be found (are you missing a using directive or an assembly reference?)
using TMDbLib.Objects.Search;

Check failure on line 22 in Shoko.Server/Models/TMDB/TMDB_Episode.cs

View workflow job for this annotation

GitHub Actions / Unit Tests

The type or namespace name 'TMDbLib' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 22 in Shoko.Server/Models/TMDB/TMDB_Episode.cs

View workflow job for this annotation

GitHub Actions / Schema Parity — SQLite vs MySQL vs SQL Server

The type or namespace name 'TMDbLib' could not be found (are you missing a using directive or an assembly reference?)
using TMDbLib.Objects.TvShows;

#pragma warning disable CS0618
Expand Down Expand Up @@ -113,6 +113,13 @@
/// </summary>
public TimeSpan? Runtime { get; set; }

/// <summary>
/// TMDB's own episode classification (<c>standard</c>, <c>finale</c>,
/// <c>mid_season</c>, <c>special</c>), verbatim from the API. <see langword="null"/>
/// until the episode is refreshed against a library build that fetches it.
/// </summary>
public string? TmdbEpisodeType { get; set; }

/// <summary>
/// Average user rating across all <see cref="UserVotes"/>.
/// </summary>
Expand Down Expand Up @@ -185,8 +192,9 @@
UpdateProperty(EnglishTitle, translations is null && !string.IsNullOrEmpty(EnglishTitle) ? EnglishTitle : !string.IsNullOrEmpty(translation?.Data?.Name) ? translation.Data.Name : episode.Name!, v => EnglishTitle = v),
UpdateProperty(EnglishOverview, !string.IsNullOrEmpty(translation?.Data?.Overview) ? translation.Data.Overview : episode.Overview!, v => EnglishOverview = v),
UpdateProperty(SeasonNumber, episode.SeasonNumber, v => SeasonNumber = v),
UpdateProperty(EpisodeNumber, episode.EpisodeNumber, v => EpisodeNumber = (int)v),
UpdateProperty(EpisodeNumber, episode.EpisodeNumber, v => EpisodeNumber = v),
UpdateProperty(Runtime, episode.Runtime.HasValue ? TimeSpan.FromMinutes(episode.Runtime.Value) : null, v => Runtime = v),
UpdateProperty(TmdbEpisodeType, string.IsNullOrWhiteSpace(episode.EpisodeType) ? null : episode.EpisodeType.Trim(), v => TmdbEpisodeType = v),
UpdateProperty(UserRating, episode.VoteAverage, v => UserRating = v),
UpdateProperty(UserVotes, episode.VoteCount, v => UserVotes = v),
UpdateProperty(AiredAt, episode.AirDate?.ToDateOnly(), v => AiredAt = v),
Expand Down
Loading
Loading