Jump to content

Get External Urls for Type Person c#?


mickle026

Recommended Posts

mickle026

How do you return the external urls for the person type in C# ?

 

Swagger shows it clearly  as ExternalUrls but this is not shown

{
  "Name": "Jeon Yeo-bin",
  "ServerId": "xxxx",
  "Id": "216819",
  "Etag": "cd0277c3c7e68691366605a4bb3d814e",
  "DateCreated": "2022-07-22T04:38:24.0000000Z",
  "CanDelete": false,
  "CanDownload": false,
  "PresentationUniqueKey": "6223cdfadb4c4990bc275b3263f8aaca",
  "SortName": "Jeon Yeo-been",
  "ForcedSortName": "Jeon Yeo-been",
  "PremiereDate": "1989-07-25T23:00:00.0000000Z",
  "ExternalUrls": [
    {
      "Name": "TheTVDB",
      "Url": "https://thetvdb.com/people/7986993"
    }
  ],
  "ProductionLocations": [
    "Gangneung, South Korea"
  ],
  "Taglines": [],
  "RemoteTrailers": [],
  "ProviderIds": {
    "Tvdb": "7986993"
  },
  "Type": "Person",
  "TagItems": [],
  "DisplayPreferencesId": "b607178b0ac2f604a458d3d2363fdc83",
  "PrimaryImageAspectRatio": 0.6666666666666666,
  "ImageTags": {
    "Primary": "36b232945ac24f9c3ad72f25b0163a09"
  },
  "BackdropImageTags": [],
  "LockedFields": [],
  "LockData": false
}

When I have an array of Person Ids,

 var CastName = libraryManager.GetItemById(item);

CastName.Name = the persons name
CastName.PremiereDate = the persons date of birth
CastName.ProductionLocations = the persons place of birth as string array
CastName.ProviderIds = the prodiver ids as a dictionary

However, CastName.ExternalUrls doesn't exist

Any help appreciated, thanks in advance

 

 

Edited by mickle026
Link to comment
Share on other sites

mickle026

I thought I had found it with GetRelatedUrls(), but it appears not :(

Not getting any output from this .

string ExtraInfoUrls = "";
foreach (var id in CastName.GetRelatedUrls())
    {
        if (!string.IsNullOrEmpty(id.Name))
        {
              ExtraInfoUrls = ExtraInfoUrls + $"ExtraUrls: {id.Name}={id.Url}" + Environment.NewLine;
        }

    };

 

Link to comment
Share on other sites

Hi, on the server they're not stored anywhere. The output that you get from the API is constructed on the fly, so that's the reason for this.

  • Thanks 1
Link to comment
Share on other sites

mickle026
13 hours ago, Luke said:

Hi, on the server they're not stored anywhere. The output that you get from the API is constructed on the fly, so that's the reason for this.

Thanks for the explanation, they are easy enough to reconstruct from the provider ids.

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...