- Re-added .qap / .queueautoplay

- Several strings and commands related to music have been changed
  - Changed .ms / .movesong to .tm / .trackmove but kept old aliases
  - Changed ~~song~~ -> 	rack throughout music module strings
- Updated CHANGELOG.md
This commit is contained in:
Kwoth
2022-02-13 15:49:48 +01:00
parent 6895c8a2a4
commit 7ed1b13e85
20 changed files with 3054 additions and 181 deletions

View File

@@ -10,7 +10,7 @@ public interface IGoogleApiService
Task<IEnumerable<string>> GetVideoLinksByKeywordAsync(string keywords, int count = 1);
Task<IEnumerable<(string Name, string Id, string Url)>> GetVideoInfosByKeywordAsync(string keywords, int count = 1);
Task<IEnumerable<string>> GetPlaylistIdsByKeywordsAsync(string keywords, int count = 1);
Task<IEnumerable<string>> GetRelatedVideosAsync(string url, int count = 1);
Task<IEnumerable<string>> GetRelatedVideosAsync(string id, int count = 1, string user = null);
Task<IEnumerable<string>> GetPlaylistTracksAsync(string playlistId, int count = 50);
Task<IReadOnlyDictionary<string, TimeSpan>> GetVideoDurationsAsync(IEnumerable<string> videoIds);
Task<ImageResult> GetImageAsync(string query);

View File

@@ -194,8 +194,7 @@ public class GoogleApiService : IGoogleApiService, INService
return (await query.ExecuteAsync()).Items.Select(i => i.Id.PlaylistId);
}
// todo future add quota users
public async Task<IEnumerable<string>> GetRelatedVideosAsync(string id, int count = 1)
public async Task<IEnumerable<string>> GetRelatedVideosAsync(string id, int count = 1, string user = null)
{
if (string.IsNullOrWhiteSpace(id))
throw new ArgumentNullException(nameof(id));
@@ -207,6 +206,7 @@ public class GoogleApiService : IGoogleApiService, INService
query.MaxResults = count;
query.RelatedToVideoId = id;
query.Type = "video";
query.QuotaUser = user;
return (await query.ExecuteAsync()).Items.Select(i => "http://www.youtube.com/watch?v=" + i.Id.VideoId);
}