Skip to content

Commit

Permalink
update to net8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ghost1372 committed Nov 20, 2023
1 parent 079237e commit 12a58be
Show file tree
Hide file tree
Showing 15 changed files with 32 additions and 30 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
dotnet-version: '8.0.x'
fetch-depth: 0

- name: Set up NuGet
Expand Down
2 changes: 1 addition & 1 deletion dev/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public partial class App : Application
public static Window currentWindow = Window.Current;
public IServiceProvider Services { get; }
public new static App Current => (App)Application.Current;
public string AppVersion { get; set; } = ApplicationHelper.GetAppVersion();
public string AppVersion { get; set; } = AssemblyInfoHelper.GetAssemblyVersion();
public string AppName { get; set; } = "TvTime";

public static T GetService<T>() where T : class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<PropertyGroup>
<Configuration>Release</Configuration>
<Platform>x64</Platform>
<PublishDir>bin\win10-x64\Publish</PublishDir>
<PublishDir>bin\win-x64\Publish</PublishDir>
<PublishProtocol>FileSystem</PublishProtocol>
<_TargetId>Folder</_TargetId>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
Expand Down
2 changes: 1 addition & 1 deletion dev/Tools/Common/AppHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public static string FixTitle(string title)

title = Regex.Replace(title, @"\s*<.*?>\s*", "", RegexOptions.Singleline);
title = title.Replace(".E..&gt;", "").Replace(">", "");
title = RemoveSpecialWords(ApplicationHelper.GetDecodedStringFromHtml(title));
title = RemoveSpecialWords(GeneralHelper.GetDecodedStringFromHtml(title));
return title;
}

Expand Down
4 changes: 2 additions & 2 deletions dev/Tools/Common/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
namespace TvTime.Common;
public static class Constants
{
public static readonly string AppName = ApplicationHelper.GetAppNameAndVersion().NameAndVersion;
public static readonly string RootDirectoryPath = Path.Combine(ApplicationHelper.GetLocalFolderPath(), AppName);
public static readonly string AppName = AssemblyInfoHelper.GetAppInfo().NameAndVersion;
public static readonly string RootDirectoryPath = Path.Combine(PathHelper.GetLocalFolderPath(), AppName);
public static readonly string LogDirectoryPath = Path.Combine(RootDirectoryPath, "Log");
public static readonly string LogFilePath = Path.Combine(LogDirectoryPath, "Log.txt");
public static readonly string AppConfigPath = Path.Combine(RootDirectoryPath, "AppConfig.json");
Expand Down
15 changes: 8 additions & 7 deletions dev/TvTime.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows10.0.19041.0</TargetFramework>
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<RootNamespace>TvTime</RootNamespace>
<ApplicationManifest>app.manifest</ApplicationManifest>
<Platforms>x86;x64</Platforms>
<RuntimeIdentifiers>win10-x86;win10-x64</RuntimeIdentifiers>
<PublishProfile>win10-$(Platform).pubxml</PublishProfile>
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
<PublishProfile>win-$(Platform).pubxml</PublishProfile>
<UseWinUI>true</UseWinUI>
<EnableMsixTooling>true</EnableMsixTooling>
<Version>4.8.1</Version>
Expand All @@ -16,6 +16,7 @@
<AccelerateBuildsInVisualStudio>False</AccelerateBuildsInVisualStudio>
<ApplicationIcon>Assets\icon.ico</ApplicationIcon>
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
<UseRidGraph>true</UseRidGraph>
</PropertyGroup>
<ItemGroup>
<None Include="Assets\**\*">
Expand All @@ -24,12 +25,12 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231008000" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.4.231115000" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.2428" />
<PackageReference Include="Serilog.Sinks.Debug" Version="2.0.0" />
<PackageReference Include="WinUICommunity.Components" Version="5.3.5" />
<PackageReference Include="WinUICommunity.Core" Version="5.3.1" />
<PackageReference Include="WinUICommunity.LandingPages" Version="5.3.1" />
<PackageReference Include="WinUICommunity.Components" Version="5.5.0" />
<PackageReference Include="WinUICommunity.Core" Version="5.5.1" />
<PackageReference Include="WinUICommunity.LandingPages" Version="5.5.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
Expand Down
2 changes: 1 addition & 1 deletion dev/ViewModels/IMDBDetailViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private async void GetIMDBDetails(string title)
{
try
{
if (ApplicationHelper.IsNetworkAvailable())
if (NetworkHelper.IsNetworkAvailable())
{
IsActive = false;

Expand Down
4 changes: 2 additions & 2 deletions dev/ViewModels/Media/MediaDetailsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public List<BaseMediaTable> GetAllServerDetails(string content, BaseMediaTable b

var finalServer = FixUriDuplication(baseMedia.Server, href);

if (finalServer.Contains("dl5.dl1acemovies", StringComparison.OrdinalIgnoreCase))
if (finalServer.Contains("acemovies", StringComparison.OrdinalIgnoreCase))
{
if (title.Equals("Home") || title.Equals("dl") ||
title.Equals("English") || title.Equals("Series") ||
Expand All @@ -156,7 +156,7 @@ public List<BaseMediaTable> GetAllServerDetails(string content, BaseMediaTable b
}
}

list.Add(new BaseMediaTable(FixTitle(title), finalServer, date, ApplicationHelper.GetFileSize(fSize), baseMedia.ServerType));
list.Add(new BaseMediaTable(FixTitle(title), finalServer, date, FileHelper.GetFileSize(fSize), baseMedia.ServerType));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions dev/ViewModels/Media/MediaViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private async void DownloadMediaIntoDatabase()
int index = 0;
foreach (var item in urls)
{
if (ApplicationHelper.IsNetworkAvailable())
if (NetworkHelper.IsNetworkAvailable())
{
try
{
Expand Down Expand Up @@ -386,7 +386,7 @@ public async Task GetAllServerDetails(string content, string server)

var finalServer = FixUriDuplication(server, href);
if (finalServer.Contains("directadmin.com", StringComparison.OrdinalIgnoreCase) ||
finalServer.Contains("dl5.dl1acemovies") && (title.Equals("Home") ||
finalServer.Contains("acemovies") && (title.Equals("Home") ||
title.Equals("dl") || title.Equals("English") || title.Equals("Series") ||
title.Equals("Movie") || title.Contains("Parent Directory")))
{
Expand Down
6 changes: 3 additions & 3 deletions dev/ViewModels/ServerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private async void OnAddServerPrimaryButton(ContentDialog sender, ContentDialogB

if (SegmentedSelectedIndex == 0)
{
var type = ApplicationHelper.GetEnum<ServerType>((dialog.CmbServerTypeSelectedItem as ComboBoxItem).Content?.ToString());
var type = GeneralHelper.GetEnum<ServerType>((dialog.CmbServerTypeSelectedItem as ComboBoxItem).Content?.ToString());
baseServer.ServerType = type;
await db.MediaServers.AddAsync(new MediaServerTable(baseServer.Title, baseServer.Server, baseServer.IsActive, baseServer.ServerType));
}
Expand Down Expand Up @@ -178,7 +178,7 @@ private async Task OnUpdateServer(object dataContext)
var oldMediaServer = await db.MediaServers.Where(x => x.Title == server.Title && x.Server == server.Server && x.ServerType == server.ServerType).FirstOrDefaultAsync();
if (oldMediaServer != null)
{
var type = ApplicationHelper.GetEnum<ServerType>((dialog.CmbServerTypeSelectedItem as ComboBoxItem).Content?.ToString());
var type = GeneralHelper.GetEnum<ServerType>((dialog.CmbServerTypeSelectedItem as ComboBoxItem).Content?.ToString());
oldMediaServer.Title = dialog.ServerTitle;
oldMediaServer.Server = dialog.ServerUrl;
Expand Down Expand Up @@ -276,7 +276,7 @@ private async Task OnLoadPredefinedServer()
filePath = Constants.DEFAULT_SUBTITLE_SERVER_PATH;
}
using var streamReader = File.OpenText(await FileLoaderHelper.GetPath(filePath));
using var streamReader = File.OpenText(await PathHelper.GetFilePath(filePath));
var json = await streamReader.ReadToEndAsync();
using var db = new AppDbContext();
if (SegmentedSelectedIndex == 0)
Expand Down
2 changes: 1 addition & 1 deletion dev/ViewModels/Settings/AppUpdateSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private async Task CheckForUpdateAsync()
IsUpdateAvailable = false;
IsCheckButtonEnabled = false;
LoadingStatus = "Checking for new version";
if (ApplicationHelper.IsNetworkAvailable())
if (NetworkHelper.IsNetworkAvailable())
{
LastUpdateCheck = DateTime.Now.ToShortDateString();
Settings.LastUpdateCheck = DateTime.Now.ToShortDateString();
Expand Down
8 changes: 4 additions & 4 deletions dev/ViewModels/Settings/BackupSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ private async Task OnBackupServer(object isMediaServer)
{
{ "Json", new List<string>() { ".json" } }
};
var file = await ApplicationHelper.PickSaveFileAsync(App.currentWindow, fileTypeChoices, fileName);
var file = await FileAndFolderPickerHelper.PickSaveFileAsync(App.currentWindow, fileTypeChoices, fileName);

if (file != null)
{
Expand Down Expand Up @@ -70,7 +70,7 @@ private async Task OnRestoreServer(object isMediaServer)
{
this.isMediaServer = Convert.ToBoolean(isMediaServer);

var file = await ApplicationHelper.PickSingleFileAsync(App.currentWindow, new string[] { ".json" });
var file = await FileAndFolderPickerHelper.PickSingleFileAsync(App.currentWindow, new string[] { ".json" });
if (file != null)
{
using var streamReader = File.OpenText(file.Path);
Expand Down Expand Up @@ -119,7 +119,7 @@ private async Task OnBackupSettings()
};
var suggestedFileName = $"TvTime-Settings-{DateTime.Now:yyyy-MM-dd HH-mm-ss}";

var file = await ApplicationHelper.PickSaveFileAsync(App.currentWindow, fileTypeChoices, suggestedFileName);
var file = await FileAndFolderPickerHelper.PickSaveFileAsync(App.currentWindow, fileTypeChoices, suggestedFileName);

if (file != null)
{
Expand All @@ -145,7 +145,7 @@ private async Task OnRestoreSettings()
{
try
{
var file = await ApplicationHelper.PickSingleFileAsync(App.currentWindow, new string[] { ".json" });
var file = await FileAndFolderPickerHelper.PickSingleFileAsync(App.currentWindow, new string[] { ".json" });

if (file != null)
{
Expand Down
2 changes: 1 addition & 1 deletion dev/ViewModels/Subtitles/SubsceneDetailViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private async void OnNavigateToDetailsOrDownload(object sender)
}
else
{
if (ApplicationHelper.IsNetworkAvailable())
if (NetworkHelper.IsNetworkAvailable())
{
try
{
Expand Down
6 changes: 3 additions & 3 deletions dev/ViewModels/Subtitles/SubsceneViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public SubsceneViewModel(IJsonNavigationViewService jsonNavigationViewService, I
using var db = new AppDbContext();
if (!db.SubtitleServers.Any())
{
using var streamReader = File.OpenText(await FileLoaderHelper.GetPath(Constants.DEFAULT_SUBTITLE_SERVER_PATH));
using var streamReader = File.OpenText(await PathHelper.GetFilePath(Constants.DEFAULT_SUBTITLE_SERVER_PATH));
var json = await streamReader.ReadToEndAsync();
var content = JsonConvert.DeserializeObject<List<SubtitleServerTable>>(json);
if (content is not null)
Expand Down Expand Up @@ -82,7 +82,7 @@ public SubsceneViewModel(IJsonNavigationViewService jsonNavigationViewService, I

public async void OnQuerySubmitted()
{
if (ApplicationHelper.IsNetworkAvailable())
if (NetworkHelper.IsNetworkAvailable())
{
try
{
Expand Down Expand Up @@ -137,7 +137,7 @@ public async void OnQuerySubmitted()
}

var name = subNode?.InnerText?.Trim();
var server = ApplicationHelper.GetDecodedStringFromHtml(baseUrl.Server + subNode?.Attributes["href"]?.Value?.Trim());
var server = GeneralHelper.GetDecodedStringFromHtml(baseUrl.Server + subNode?.Attributes["href"]?.Value?.Trim());
var subtitle = new SubtitleModel(name, server);
subtitle.Description = count?.InnerText?.Trim();
subtitle.GroupKey = GetSubtitleKey(i);
Expand Down
2 changes: 1 addition & 1 deletion dev/Views/Media/MediaPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
{
base.OnNavigatedTo(e);
var pageType = (e.Parameter as DataItem).Parameter?.ToString();
this.PageType = ApplicationHelper.GetEnum<ServerType>(pageType);
this.PageType = GeneralHelper.GetEnum<ServerType>(pageType);
}

private void ItemUserControl_Loading(FrameworkElement sender, object args)
Expand Down

0 comments on commit 12a58be

Please sign in to comment.