Skip to content

Commit

Permalink
upload new version
Browse files Browse the repository at this point in the history
  • Loading branch information
yaronzz committed Sep 9, 2020
1 parent e01aa0a commit 7ff5905
Show file tree
Hide file tree
Showing 11 changed files with 1,495 additions and 1,279 deletions.
142 changes: 71 additions & 71 deletions TIDALDL-UI-PRO/Else/CoverCard.cs
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;
}
}
}
101 changes: 54 additions & 47 deletions TIDALDL-UI-PRO/Else/Global.cs
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;

}

}
Loading

0 comments on commit 7ff5905

Please sign in to comment.