jensenkd / plex-api

.NET Core SDK for Plex Media Server
MIT License
87 stars 27 forks source link

Metadata - Add Agent Info #8

Closed bbakermmc closed 4 years ago

bbakermmc commented 4 years ago

Can you add the Agent info on the Meta object. This basically tells what agent was used for the plex match. This way if you have the IMDB or TMDBID you can compare them that way.

guid="com.plexapp.agents.imdb://tt0322259?lang=en" ExternalProvider = imdb ExternalProviderId = tt0322259

public string ExternalProvider { get; set; }
        public string ExternalProviderId { get; set; }

        [JsonProperty("guid")]
        public string ExternalProviderInfo
        {
            get => null;
            set
            {
                var match = Regex.Match(value, @"\.(?<provider>[a-z]+)://(?<id>[^\?]+)");
                ExternalProvider = match.Groups["provider"].Value;
                ExternalProviderId = match.Groups["id"].Value;
            }
        }
jensenkd commented 4 years ago

@bbakermmc Yep! I like that and can use it myself.

jensenkd commented 4 years ago

Plex.Api 1.0.94

I also preserved the original Guid field

bbakermmc commented 4 years ago

This is good