mirror of
https://github.com/lidarr/Lidarr
synced 2025-03-12 23:13:44 +00:00
Fixed: Correctly page through Spotify followed artists
This commit is contained in:
parent
f4e4bae465
commit
ea8d19a513
3 changed files with 9 additions and 8 deletions
|
@ -132,8 +132,8 @@ namespace NzbDrone.Core.Test.ImportListTests
|
|||
Mocker.GetMock<ISpotifyProxy>()
|
||||
.Setup(x => x.GetNextPage(It.IsAny<SpotifyFollowedArtists>(),
|
||||
It.IsAny<SpotifyWebAPI>(),
|
||||
It.IsAny<CursorPaging<FullArtist>>()))
|
||||
.Returns(default(CursorPaging<FullArtist>));
|
||||
It.IsAny<FollowedArtists>()))
|
||||
.Returns(default(FollowedArtists));
|
||||
|
||||
var result = Subject.Fetch(api);
|
||||
|
||||
|
@ -142,7 +142,7 @@ namespace NzbDrone.Core.Test.ImportListTests
|
|||
Mocker.GetMock<ISpotifyProxy>()
|
||||
.Verify(v => v.GetNextPage(It.IsAny<SpotifyFollowedArtists>(),
|
||||
It.IsAny<SpotifyWebAPI>(),
|
||||
It.IsAny<CursorPaging<FullArtist>>()),
|
||||
It.IsAny<FollowedArtists>()),
|
||||
Times.Once());
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,8 @@ namespace NzbDrone.Core.ImportLists.Spotify
|
|||
break;
|
||||
}
|
||||
|
||||
artists = _spotifyProxy.GetNextPage(this, api, artists);
|
||||
followedArtists = _spotifyProxy.GetNextPage(this, api, followedArtists);
|
||||
artists = followedArtists?.Artists;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace NzbDrone.Core.ImportLists.Spotify
|
|||
where TSettings : SpotifySettingsBase<TSettings>, new();
|
||||
Paging<T> GetNextPage<T, TSettings>(SpotifyImportListBase<TSettings> list, SpotifyWebAPI api, Paging<T> item)
|
||||
where TSettings : SpotifySettingsBase<TSettings>, new();
|
||||
CursorPaging<T> GetNextPage<T, TSettings>(SpotifyImportListBase<TSettings> list, SpotifyWebAPI api, CursorPaging<T> item)
|
||||
FollowedArtists GetNextPage<TSettings>(SpotifyImportListBase<TSettings> list, SpotifyWebAPI api, FollowedArtists item)
|
||||
where TSettings : SpotifySettingsBase<TSettings>, new();
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ namespace NzbDrone.Core.ImportLists.Spotify
|
|||
public FollowedArtists GetFollowedArtists<TSettings>(SpotifyImportListBase<TSettings> list, SpotifyWebAPI api)
|
||||
where TSettings : SpotifySettingsBase<TSettings>, new()
|
||||
{
|
||||
return Execute(list, api, x => x.GetFollowedArtists(FollowType.Artist));
|
||||
return Execute(list, api, x => x.GetFollowedArtists(FollowType.Artist, 50));
|
||||
}
|
||||
|
||||
public Paging<SavedAlbum> GetSavedAlbums<TSettings>(SpotifyImportListBase<TSettings> list, SpotifyWebAPI api)
|
||||
|
@ -69,10 +69,10 @@ namespace NzbDrone.Core.ImportLists.Spotify
|
|||
return Execute(list, api, (x) => x.GetNextPage(item));
|
||||
}
|
||||
|
||||
public CursorPaging<T> GetNextPage<T, TSettings>(SpotifyImportListBase<TSettings> list, SpotifyWebAPI api, CursorPaging<T> item)
|
||||
public FollowedArtists GetNextPage<TSettings>(SpotifyImportListBase<TSettings> list, SpotifyWebAPI api, FollowedArtists item)
|
||||
where TSettings : SpotifySettingsBase<TSettings>, new()
|
||||
{
|
||||
return Execute(list, api, (x) => x.GetNextPage(item));
|
||||
return Execute(list, api, (x) => x.GetNextPage<FollowedArtists, FullArtist>(item.Artists));
|
||||
}
|
||||
|
||||
public T Execute<T, TSettings>(SpotifyImportListBase<TSettings> list, SpotifyWebAPI api, Func<SpotifyWebAPI, T> method, bool allowReauth = true)
|
||||
|
|
Loading…
Add table
Reference in a new issue