-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,495 additions
and
1,279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,71 +1,71 @@ | ||
using AIGS.Common; | ||
using AIGS.Helper; | ||
using Stylet; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using static AIGS.Helper.HttpHelper; | ||
|
||
namespace TIDALDL_UI.Else | ||
{ | ||
public class CoverCard | ||
{ | ||
public string ImgUrl { get; set; } | ||
public string Title { get; set; } | ||
public string SubTitle { get; set; } | ||
public string Url { get; set; } | ||
|
||
public static async Task<ObservableCollection<CoverCard>> GetList() | ||
{ | ||
try | ||
{ | ||
Result result = await HttpHelper.GetOrPostAsync("https://cdn.jsdelivr.net/gh/yaronzz/CDN/app/tidal/todaycards.json"); | ||
if(result.sData.IsNotBlank()) | ||
{ | ||
ObservableCollection<CoverCard> pList = JsonHelper.ConverStringToObject<ObservableCollection<CoverCard>>(result.sData); | ||
return pList; | ||
} | ||
} | ||
catch { } | ||
return GetDefaultList(); | ||
} | ||
|
||
private static ObservableCollection<CoverCard> GetDefaultList() | ||
{ | ||
CoverCard card1 = new CoverCard() | ||
{ | ||
ImgUrl = "https://resources.tidal.com/images/19e4f65c/97f5/43b3/b0ff/7855f0646f95/320x320.jpg", | ||
Title = "1989 (Deluxe Edition)", | ||
SubTitle = "Taylor Swift", | ||
Url = "https://listen.tidal.com/album/121444594", | ||
}; | ||
CoverCard card2 = new CoverCard() | ||
{ | ||
ImgUrl = "https://resources.tidal.com/images/5ea6c02a/938d/4641/8fd9/8de90df7d087/320x320.jpg", | ||
Title = "Happy End", | ||
SubTitle = "Back Number", | ||
Url = "https://listen.tidal.com/album/103578093", | ||
}; | ||
CoverCard card3 = new CoverCard() | ||
{ | ||
ImgUrl = "https://resources.tidal.com/images/bf3796e4/52f2/4d4b/896c/e39ce41a17df/320x320.jpg", | ||
Title = "Doo-Wops & Hooligans", | ||
SubTitle = "Bruno Mars", | ||
Url = "https://listen.tidal.com/album/4935184", | ||
}; | ||
ObservableCollection<CoverCard> pCards = new ObservableCollection<CoverCard>(); | ||
pCards.Add(card1); | ||
pCards.Add(card2); | ||
pCards.Add(card3); | ||
|
||
string sjson = JsonHelper.ConverObjectToString<ObservableCollection<CoverCard>>(pCards); | ||
FileHelper.Write(sjson, true, "./covercards.json"); | ||
|
||
return pCards; | ||
} | ||
} | ||
} | ||
using AIGS.Common; | ||
using AIGS.Helper; | ||
using Stylet; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Collections.ObjectModel; | ||
using System.Linq; | ||
using System.Runtime.CompilerServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using static AIGS.Helper.HttpHelper; | ||
|
||
namespace TIDALDL_UI.Else | ||
{ | ||
public class CoverCard | ||
{ | ||
public string ImgUrl { get; set; } | ||
public string Title { get; set; } | ||
public string SubTitle { get; set; } | ||
public string Url { get; set; } | ||
|
||
public static async Task<ObservableCollection<CoverCard>> GetList() | ||
{ | ||
try | ||
{ | ||
Result result = await HttpHelper.GetOrPostAsync("https://cdn.jsdelivr.net/gh/yaronzz/CDN@latest/app/tidal/todaycards.json"); | ||
if(result.sData.IsNotBlank()) | ||
{ | ||
ObservableCollection<CoverCard> pList = JsonHelper.ConverStringToObject<ObservableCollection<CoverCard>>(result.sData); | ||
return pList; | ||
} | ||
} | ||
catch { } | ||
return GetDefaultList(); | ||
} | ||
|
||
private static ObservableCollection<CoverCard> GetDefaultList() | ||
{ | ||
CoverCard card1 = new CoverCard() | ||
{ | ||
ImgUrl = "https://resources.tidal.com/images/19e4f65c/97f5/43b3/b0ff/7855f0646f95/320x320.jpg", | ||
Title = "1989 (Deluxe Edition)", | ||
SubTitle = "Taylor Swift", | ||
Url = "https://listen.tidal.com/album/121444594", | ||
}; | ||
CoverCard card2 = new CoverCard() | ||
{ | ||
ImgUrl = "https://resources.tidal.com/images/5ea6c02a/938d/4641/8fd9/8de90df7d087/320x320.jpg", | ||
Title = "Happy End", | ||
SubTitle = "Back Number", | ||
Url = "https://listen.tidal.com/album/103578093", | ||
}; | ||
CoverCard card3 = new CoverCard() | ||
{ | ||
ImgUrl = "https://resources.tidal.com/images/bf3796e4/52f2/4d4b/896c/e39ce41a17df/320x320.jpg", | ||
Title = "Doo-Wops & Hooligans", | ||
SubTitle = "Bruno Mars", | ||
Url = "https://listen.tidal.com/album/4935184", | ||
}; | ||
ObservableCollection<CoverCard> pCards = new ObservableCollection<CoverCard>(); | ||
pCards.Add(card1); | ||
pCards.Add(card2); | ||
pCards.Add(card3); | ||
|
||
string sjson = JsonHelper.ConverObjectToString<ObservableCollection<CoverCard>>(pCards); | ||
FileHelper.Write(sjson, true, "./covercards.json"); | ||
|
||
return pCards; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,54 @@ | ||
using AIGS.Common; | ||
using AIGS.Helper; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using TIDALDL_UI.Pages; | ||
using TidalLib; | ||
|
||
namespace TIDALDL_UI.Else | ||
{ | ||
public class Global : ViewMoudleBase | ||
{ | ||
public static MainViewModel VMMain { get; set; } | ||
public static Settings Settings { get; set; } | ||
|
||
public static LoginKey CommonKey { get; set; } | ||
public static LoginKey VideoKey { get; set; } | ||
public static LoginKey AccessKey { get; set; } | ||
|
||
//Path | ||
public static string PATH_BASE = SystemHelper.GetUserFolders().PersonalPath + "\\Tidal-gui\\data\\"; | ||
public static string PATH_SETTINGS = PATH_BASE + "settings.json"; | ||
public static string PATH_USERSETTINGS = PATH_BASE + "usersettings.json"; | ||
|
||
//url | ||
public static string URL_TIDAL_GROUP = "https://t.me/tidal_group"; | ||
public static string URL_TIDAL_GITHUB = "https://github.com/yaronzz/Tidal-Media-Downloader-PRO"; | ||
public static string URL_TIDAL_ISSUES = "https://github.com/yaronzz/Tidal-Media-Downloader-PRO/issues"; | ||
public static string URL_PAYPAL = "https://www.paypal.com/paypalme/yaronzz"; | ||
public static string URL_BUYMEACOFFEE = "https://www.buymeacoffee.com/yaronzz"; | ||
|
||
//Token | ||
public static string TOKEN_MAIN = "MainToken"; | ||
public static string TOKEN_LOGIN = "LoginToken"; | ||
|
||
|
||
//Global DynamicResource | ||
//public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged; | ||
|
||
} | ||
|
||
} | ||
using AIGS.Common; | ||
using AIGS.Helper; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using TIDALDL_UI.Pages; | ||
using TidalLib; | ||
|
||
namespace TIDALDL_UI.Else | ||
{ | ||
public class Global : ViewMoudleBase | ||
{ | ||
public static MainViewModel VMMain { get; set; } | ||
public static Settings Settings { get; set; } | ||
|
||
public static LoginKey CommonKey { get; set; } | ||
public static LoginKey VideoKey { get; set; } | ||
public static LoginKey AccessKey { get; set; } | ||
|
||
//Path | ||
public static string PATH_BASE = SystemHelper.GetUserFolders().PersonalPath + "\\Tidal-gui\\"; | ||
public static string PATH_SETTINGS = PATH_BASE + "data\\settings.json"; | ||
public static string PATH_USERSETTINGS = PATH_BASE + "data\\usersettings.json"; | ||
public static string PATH_UPDATE = PATH_BASE + "download\\"; | ||
|
||
//url | ||
public static string URL_TIDAL_GROUP = "https://t.me/tidal_group"; | ||
public static string URL_TIDAL_GITHUB = "https://github.com/yaronzz/Tidal-Media-Downloader-PRO"; | ||
public static string URL_TIDAL_ISSUES = "https://github.com/yaronzz/Tidal-Media-Downloader-PRO/issues"; | ||
public static string URL_PAYPAL = "https://www.paypal.com/paypalme/yaronzz"; | ||
public static string URL_BUYMEACOFFEE = "https://www.buymeacoffee.com/yaronzz"; | ||
|
||
//update | ||
public static string NAME_GITHUB_AUTHOR = "yaronzz"; | ||
public static string NAME_GITHUB_PROJECT = "Tidal-Media-Downloader-PRO"; | ||
public static string NAME_GITHUB_FILE = "tidal-gui.exe"; | ||
public static string KEY_BASE = "fa^8jk@j9d"; | ||
|
||
//Token | ||
public static string TOKEN_MAIN = "MainToken"; | ||
public static string TOKEN_LOGIN = "LoginToken"; | ||
|
||
|
||
//Global DynamicResource | ||
//public static event EventHandler<PropertyChangedEventArgs> StaticPropertyChanged; | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.