diff --git a/src/Podsync/Controllers/FeedController.cs b/src/Podsync/Controllers/FeedController.cs index 0218237..d0e2cb9 100644 --- a/src/Podsync/Controllers/FeedController.cs +++ b/src/Podsync/Controllers/FeedController.cs @@ -8,7 +8,6 @@ using Microsoft.AspNetCore.Mvc; using Podsync.Helpers; using Podsync.Services; using Podsync.Services.Links; -using Podsync.Services.Resolver; using Podsync.Services.Rss; using Podsync.Services.Rss.Contracts; using Podsync.Services.Storage; @@ -47,7 +46,7 @@ namespace Podsync.Controllers Provider = linkInfo.Provider, LinkType = linkInfo.LinkType, Id = linkInfo.Id, - Quality = request.Quality ?? ResolveFormat.VideoHigh, + Quality = request.Quality ?? Constants.DefaultFormat, PageSize = request.PageSize ?? Constants.DefaultPageSize }; @@ -59,7 +58,8 @@ namespace Podsync.Controllers } else { - feed.Quality = ResolveFormat.VideoHigh; + feed.Quality = Constants.DefaultFormat; + feed.PageSize = Constants.DefaultPageSize; } var feedId = await _feedService.Create(feed); diff --git a/src/Podsync/Services/Rss/Builders/YouTubeRssBuilder.cs b/src/Podsync/Services/Rss/Builders/YouTubeRssBuilder.cs index 0c9eca9..e2f0a93 100644 --- a/src/Podsync/Services/Rss/Builders/YouTubeRssBuilder.cs +++ b/src/Podsync/Services/Rss/Builders/YouTubeRssBuilder.cs @@ -50,10 +50,10 @@ namespace Podsync.Services.Rss.Builders } // Get video ids from this playlist - var ids = await _youTube.GetPlaylistItemIds(new PlaylistItemsQuery { PlaylistId = channel.Guid }); + var ids = await _youTube.GetPlaylistItemIds(new PlaylistItemsQuery { PlaylistId = channel.Guid, Count = metadata.PageSize }); // Get video descriptions - var videos = await _youTube.GetVideos(new VideoQuery { Id = string.Join(",", ids) }); + var videos = await _youTube.GetVideos(new VideoQuery { Ids = ids }); channel.Items = videos.Select(youtubeVideo => MakeItem(youtubeVideo, metadata)).ToArray(); diff --git a/src/Podsync/Services/Rss/FeedService.cs b/src/Podsync/Services/Rss/FeedService.cs index 68746e0..7a58676 100644 --- a/src/Podsync/Services/Rss/FeedService.cs +++ b/src/Podsync/Services/Rss/FeedService.cs @@ -24,8 +24,6 @@ namespace Podsync.Services.Rss throw new ArgumentException("Only YouTube supports audio feeds"); } - metadata.PageSize = Constants.DefaultPageSize; - return _storageService.Save(metadata); } diff --git a/src/Podsync/Services/Videos/YouTube/VideoQuery.cs b/src/Podsync/Services/Videos/YouTube/VideoQuery.cs index 1b32af7..68ee669 100644 --- a/src/Podsync/Services/Videos/YouTube/VideoQuery.cs +++ b/src/Podsync/Services/Videos/YouTube/VideoQuery.cs @@ -1,9 +1,9 @@ -namespace Podsync.Services.Videos.YouTube +using System.Collections.Generic; + +namespace Podsync.Services.Videos.YouTube { public struct VideoQuery { - public string Id { get; set; } - - public int? Count { get; set; } + public ICollection Ids { get; set; } } } \ No newline at end of file diff --git a/src/Podsync/Services/Videos/YouTube/YouTubeClient.cs b/src/Podsync/Services/Videos/YouTube/YouTubeClient.cs index f4bd4a8..81e2b2f 100644 --- a/src/Podsync/Services/Videos/YouTube/YouTubeClient.cs +++ b/src/Podsync/Services/Videos/YouTube/YouTubeClient.cs @@ -71,17 +71,18 @@ namespace Podsync.Services.Videos.YouTube { var request = _youtube.Videos.List("id,snippet,contentDetails"); - request.Id = query.Id; + var totalCount = query.Ids.Count; + var pageIndex = 0; - return AggregatePages