Release 1.0.0.5: artist people links
This commit is contained in:
1 parent
0dbf427ce1
commit
230616e4fc
8 files changed
+55
-12
No files matched your search
@@ -27,13 +27,13 @@ public class AlbumArtistTask : IScheduledTask
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Name => "Yandex Music: заполнить исполнителей альбомов";
|
||||
public string Name => "Yandex Music: создать исполнителей";
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Key => "YandexMusicAlbumArtists";
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Description => "Заполняет AlbumArtists у треков, чтобы Jellyfin создал исполнителей и альбомы.";
|
||||
public string Description => "Заполняет AlbumArtists и связи исполнителей, чтобы Jellyfin создал страницы исполнителей.";
|
||||
|
||||
/// <inheritdoc />
|
||||
public string Category => "Yandex Music";
|
||||
@@ -75,6 +75,30 @@ public class AlbumArtistTask : IScheduledTask
|
||||
updated++;
|
||||
}
|
||||
|
||||
var people = new List<MediaBrowser.Controller.Entities.PersonInfo>();
|
||||
foreach (var name in item.AlbumArtists)
|
||||
{
|
||||
people.Add(new MediaBrowser.Controller.Entities.PersonInfo
|
||||
{
|
||||
Name = name,
|
||||
Type = Jellyfin.Data.Enums.PersonKind.AlbumArtist
|
||||
});
|
||||
}
|
||||
|
||||
foreach (var name in item.Artists)
|
||||
{
|
||||
people.Add(new MediaBrowser.Controller.Entities.PersonInfo
|
||||
{
|
||||
Name = name,
|
||||
Type = Jellyfin.Data.Enums.PersonKind.Artist
|
||||
});
|
||||
}
|
||||
|
||||
if (people.Count > 0)
|
||||
{
|
||||
await _libraryManager.UpdatePeopleAsync(item, people, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
progress.Report(100.0 * (i + 1) / Math.Max(1, items.Count));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user