Made Personal Lists on Downloader in proxy
This commit is contained in:
parent
75fe70a1e7
commit
ce2cd5b0f9
|
@ -149,6 +149,16 @@ namespace Tesses.YouTubeDownloader
|
||||||
var store = Storage as IWritable;
|
var store = Storage as IWritable;
|
||||||
if(store != null && callback != null) await callback(store);
|
if(store != null && callback != null) await callback(store);
|
||||||
}
|
}
|
||||||
|
public async Task DownloaderAsITYTDBaseAsync(Func<ITYTDBase,Task> callback)
|
||||||
|
{
|
||||||
|
var store = Downloader as ITYTDBase;
|
||||||
|
if(store != null && callback != null) await callback(store);
|
||||||
|
}
|
||||||
|
public void DownloaderAsITYTDBase(Action<ITYTDBase> callback)
|
||||||
|
{
|
||||||
|
var store = Downloader as ITYTDBase;
|
||||||
|
if(store != null && callback != null) callback(store);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public DownloaderMigration Migration
|
public DownloaderMigration Migration
|
||||||
|
@ -332,13 +342,9 @@ namespace Tesses.YouTubeDownloader
|
||||||
|
|
||||||
public async IAsyncEnumerable<ListContentItem> GetPersonalPlaylistContentsAsync(string name)
|
public async IAsyncEnumerable<ListContentItem> GetPersonalPlaylistContentsAsync(string name)
|
||||||
{
|
{
|
||||||
IAsyncEnumerable<ListContentItem> items=null;
|
if(Downloader == null) yield break;
|
||||||
StorageAsStorage((e)=>{
|
|
||||||
items=e.GetPersonalPlaylistContentsAsync(name);
|
|
||||||
|
|
||||||
});
|
await foreach(var item in Downloader.GetPersonalPlaylistContentsAsync(name))
|
||||||
if(items == null) yield break;
|
|
||||||
await foreach(var item in items)
|
|
||||||
{
|
{
|
||||||
yield return await Task.FromResult(item);
|
yield return await Task.FromResult(item);
|
||||||
}
|
}
|
||||||
|
@ -431,11 +437,17 @@ namespace Tesses.YouTubeDownloader
|
||||||
|
|
||||||
public async IAsyncEnumerable<string> GetPersonalPlaylistsAsync()
|
public async IAsyncEnumerable<string> GetPersonalPlaylistsAsync()
|
||||||
{
|
{
|
||||||
await foreach(var item in Storage.GetPersonalPlaylistsAsync())
|
if(Downloader == null) yield break;
|
||||||
|
IAsyncEnumerable<string> items=null;
|
||||||
|
DownloaderAsITYTDBase((e)=>{
|
||||||
|
items=e.GetPersonalPlaylistsAsync();
|
||||||
|
|
||||||
|
});
|
||||||
|
if(items == null) yield break;
|
||||||
|
await foreach(var item in items)
|
||||||
{
|
{
|
||||||
yield return await Task.FromResult(item);
|
yield return await Task.FromResult(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<(string Path, bool Delete)> GetRealUrlOrPathAsync(string path)
|
public async Task<(string Path, bool Delete)> GetRealUrlOrPathAsync(string path)
|
||||||
|
@ -630,43 +642,43 @@ namespace Tesses.YouTubeDownloader
|
||||||
|
|
||||||
public async Task AddToPersonalPlaylistAsync(string name, IEnumerable<ListContentItem> items)
|
public async Task AddToPersonalPlaylistAsync(string name, IEnumerable<ListContentItem> items)
|
||||||
{
|
{
|
||||||
await StorageAsStorageAsync(async(e)=>{
|
if(Downloader ==null) return;
|
||||||
await e.AddToPersonalPlaylistAsync(name,items);
|
await Downloader.AddToPersonalPlaylistAsync(name,items);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task ReplacePersonalPlaylistAsync(string name, IEnumerable<ListContentItem> items)
|
public async Task ReplacePersonalPlaylistAsync(string name, IEnumerable<ListContentItem> items)
|
||||||
{
|
{
|
||||||
await StorageAsStorageAsync(async(e)=>{
|
if(Downloader ==null) return;
|
||||||
await e.ReplacePersonalPlaylistAsync(name,items);
|
await Downloader.ReplacePersonalPlaylistAsync(name,items);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task RemoveItemFromPersonalPlaylistAsync(string name, VideoId id)
|
public async Task RemoveItemFromPersonalPlaylistAsync(string name, VideoId id)
|
||||||
{
|
{
|
||||||
await StorageAsStorageAsync(async(e)=>{
|
if(Downloader ==null) return;
|
||||||
await e.RemoveItemFromPersonalPlaylistAsync(name,id);
|
await Downloader.RemoveItemFromPersonalPlaylistAsync(name,id);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task SetResolutionForItemInPersonalPlaylistAsync(string name, VideoId id, Resolution resolution)
|
public async Task SetResolutionForItemInPersonalPlaylistAsync(string name, VideoId id, Resolution resolution)
|
||||||
{
|
{
|
||||||
await StorageAsStorageAsync(async(e)=>{
|
if(Downloader ==null) return;
|
||||||
await e.SetResolutionForItemInPersonalPlaylistAsync(name,id,resolution);
|
await Downloader.SetResolutionForItemInPersonalPlaylistAsync(name,id,resolution);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool PersonalPlaylistExists(string name)
|
public bool PersonalPlaylistExists(string name)
|
||||||
{
|
{
|
||||||
if(Storage ==null) return false;
|
if(Downloader ==null) return false;
|
||||||
return Storage.PersonalPlaylistExists(name);
|
return Downloader.PersonalPlaylistExists(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeletePersonalPlaylist(string name)
|
public void DeletePersonalPlaylist(string name)
|
||||||
{
|
{
|
||||||
StorageAsStorage((e)=>{
|
if(Downloader ==null) return;
|
||||||
e.DeletePersonalPlaylist(name);
|
Downloader.DeletePersonalPlaylist(name);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,9 @@
|
||||||
<PackageId>Tesses.YouTubeDownloader</PackageId>
|
<PackageId>Tesses.YouTubeDownloader</PackageId>
|
||||||
<Author>Mike Nolan</Author>
|
<Author>Mike Nolan</Author>
|
||||||
<Company>Tesses</Company>
|
<Company>Tesses</Company>
|
||||||
<Version>1.2.1</Version>
|
<Version>1.2.2</Version>
|
||||||
<AssemblyVersion>1.2.1</AssemblyVersion>
|
<AssemblyVersion>1.2.2</AssemblyVersion>
|
||||||
<FileVersion>1.2.1</FileVersion>
|
<FileVersion>1.2.2</FileVersion>
|
||||||
<Description>A YouTube Downloader</Description>
|
<Description>A YouTube Downloader</Description>
|
||||||
<PackageLicenseExpression>LGPL-3.0-only</PackageLicenseExpression>
|
<PackageLicenseExpression>LGPL-3.0-only</PackageLicenseExpression>
|
||||||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
||||||
|
|
Loading…
Reference in New Issue