Skip to content

Commit

Permalink
tweak: optimize search match
Browse files Browse the repository at this point in the history
  • Loading branch information
cxfksword committed Nov 29, 2023
1 parent 2d25d39 commit 17a2d09
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Jellyfin.Plugin.MetaShark.Test/DoubanApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public TestContext TestContext
[TestMethod]
public void TestSearch()
{
var keyword = "V字仇杀队";
var keyword = "声生不息";
var api = new DoubanApi(loggerFactory);

Task.Run(async () =>
Expand Down
6 changes: 6 additions & 0 deletions Jellyfin.Plugin.MetaShark/Api/DoubanApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ public async Task<List<DoubanSubject>> SearchAsync(string keyword, CancellationT
foreach (var movieElement in movieElements)
{

var ratingStr = movieElement.GetText("div.rating-info") ?? string.Empty;
if (ratingStr.Contains("尚未播出"))
{
continue;
}

var rating = movieElement.GetText("div.rating-info>.rating_nums") ?? "0";
var img = movieElement.GetAttr("a.nbg>img", "src") ?? string.Empty;
var oncick = movieElement.GetAttr("div.title a", "onclick") ?? string.Empty;
Expand Down
4 changes: 4 additions & 0 deletions Jellyfin.Plugin.MetaShark/Providers/SeriesProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ private async Task<MetadataResult<Series>> GetMetadataByTmdb(string? tmdbId, Ite
{
return tmdbId;
}
else
{
this.Log($"Can not found tmdb [id] by name: \"{name}\" and year: \"{year}\"");
}
}

return null;
Expand Down

0 comments on commit 17a2d09

Please sign in to comment.