Jump to content

C# - Path property not assigned


PlutoIsAPlanet

Recommended Posts

PlutoIsAPlanet

Greetings all,

a bit of an extension to my previous mail, I hope this merits a new question:

In the web interface, I can see the following (snipped) information:

grafik.png.f523635ad79e084ad4a63dc2752a73fe.png

As mentioned in the previous mail, I'm attempting to update the metadata by inserting/replacing the name of the artist, into the items AlbumArtists collection (a NameIdPair array).

If I have the name of the artist, then this does the trick:

song.ArtistItems = new NameIdPair[] { new NameIdPair { Id = ARTIST_ID, Name = ARTIST } };

The problem is, that the whilst I can see certain properties of the BaseItemDto item, the Path property is null, so I'm unable to programmatically extract the name of the artist for further usage.

grafik.png.2d4f30c91cda227c05cfdf91f8ad3e16.png

I'd appreciate any ideas you might have!

Link to comment
Share on other sites

Hi.  Albums don't have paths because they are not derived from the file system.  They come from the tags in the songs.

You would have to look at the song paths.

Link to comment
Share on other sites

PlutoIsAPlanet
19 minutes ago, ebr said:

Hi.  Albums don't have paths because they are not derived from the file system.  They come from the tags in the songs.

You would have to look at the song paths.

Thank you for the clarification @ebr - to be fair, I believed I was dealing with a song!

As far as I can see and please, correct me if I'm wrong, there seems to be a slight difference when invoking GetItemsAsync compared to GetItemAsync.

After providing an ItemQuery for GetItemsAsync, I can't see the Path property.
When invoking GetItemAsync with the same criteria, I see what I was hoping for as well as further information (e.g. Container; DateCreated) not included in the first query.

 

grafik.png

Link to comment
Share on other sites

1 hour ago, PlutoIsAPlanet said:

there seems to be a slight difference when invoking GetItemsAsync compared to GetItemAsync.

There are actually a lot of differences.  The former is designed to get a large group of items to display in a list or grid and, for that, we don't need a lot of the bulky information that exists for items.  So, many fields are optional.  You can include the ones you want with the "Fields" query parameter.  The latter retrieves all information for a single item.

  • 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...