Skip to content

Commit

Permalink
Add ProviderId in utils metadata functions (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalsai committed May 25, 2024
1 parent d3c2d1d commit 1907b3c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ public AbstractYoutubeRemoteProvider(IFileSystem fileSystem,
public static MetadataResult<Movie> YTDLJsonToMovie(YTDLData json, string id)
{
var result = Utils.YTDLJsonToMovie(json);
result.Item.ProviderIds.Add(Constants.PluginName, id);
return result;
}

Expand All @@ -62,7 +61,6 @@ public static MetadataResult<Movie> YTDLJsonToMovie(YTDLData json, string id)
public static MetadataResult<MusicVideo> YTDLJsonToMusicVideo(YTDLData json, string id)
{
var result = Utils.YTDLJsonToMusicVideo(json);
result.Item.ProviderIds.Add(Constants.PluginName, id);
return result;
}

Expand All @@ -74,7 +72,6 @@ public static MetadataResult<MusicVideo> YTDLJsonToMusicVideo(YTDLData json, str
public static MetadataResult<Episode> YTDLJsonToEpisode(YTDLData json, string id)
{
var result = Utils.YTDLJsonToEpisode(json);
result.Item.ProviderIds.Add(Constants.PluginName, id);
return result;
}
public static bool IsFresh(MediaBrowser.Model.IO.FileSystemMetadata fileInfo)
Expand Down
3 changes: 3 additions & 0 deletions Jellyfin.Plugin.YoutubeMetadata/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ public static MetadataResult<Movie> YTDLJsonToMovie(YTDLData json)
result.Item.ProductionYear = date.Year;
result.Item.PremiereDate = date;
result.AddPerson(Utils.CreatePerson(json.uploader, json.channel_id));
result.Item.ProviderIds.Add(Constants.PluginName, json.id);
return result;
}

Expand Down Expand Up @@ -242,6 +243,7 @@ public static MetadataResult<MusicVideo> YTDLJsonToMusicVideo(YTDLData json)
result.Item.ProductionYear = date.Year;
result.Item.PremiereDate = date;
result.AddPerson(Utils.CreatePerson(json.uploader, json.channel_id));
result.Item.ProviderIds.Add(Constants.PluginName, json.id);
return result;
}

Expand Down Expand Up @@ -275,6 +277,7 @@ public static MetadataResult<Episode> YTDLJsonToEpisode(YTDLData json)
result.AddPerson(Utils.CreatePerson(json.uploader, json.channel_id));
result.Item.IndexNumber = 1;
result.Item.ParentIndexNumber = 1;
result.Item.ProviderIds.Add(Constants.PluginName, json.id);
return result;
}

Expand Down
1 change: 1 addition & 0 deletions Jellyfin.Plugin.YoutubeMetadata/YTDLData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class ThumbnailInfo
}
public class YTDLData
{
public string id { get; set; }
// Human name
public string uploader { get; set; }
public string upload_date { get; set; }
Expand Down

0 comments on commit 1907b3c

Please sign in to comment.