-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
7 changed files
with
213 additions
and
27 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
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
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
|
||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net7.0</TargetFramework> | ||
<ApplicationIcon>nitefox_icon.ico</ApplicationIcon> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="BlazorAnimation" Version="2.2.0" /> | ||
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="6.6.2" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" /> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.WebView" Version="7.0.13" /> | ||
<PackageReference Include="MudBlazor" Version="6.11.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0"/> | ||
<PackageReference Include="Photino.Blazor" Version="2.6.0"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Content Update="wwwroot\**"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="nitefox_icon.ico"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\app.css" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\bootstrap\bootstrap.min.css" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\bootstrap\bootstrap.min.css.map" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\custom.css" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\FONT-LICENSE" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\css\open-iconic-bootstrap.min.css" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.eot" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.otf" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.svg" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.ttf" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\font\fonts\open-iconic.woff" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\ICON-LICENSE" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\css\open-iconic\README.md" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\index.html" /> | ||
<_ContentIncludedByDefault Remove="wwwroot\sample-data\weather.json" /> | ||
<_ContentIncludedByDefault Remove="Shared\MainLayout.razor" /> | ||
<_ContentIncludedByDefault Remove="Shared\NavMenu.razor" /> | ||
<_ContentIncludedByDefault Remove="Shared\SurveyPrompt.razor" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Nitefox.Client.Shared\Nitefox.Client.Shared.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using System; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using Nitefox.App.Services.Interfaces; | ||
using Nitefox.Client.Photino.Services; | ||
using Nitefox.Client.Shared; | ||
using Photino.Blazor; | ||
|
||
namespace Nitefox.Client.Photino | ||
{ | ||
class Program | ||
{ | ||
[STAThread] | ||
static void Main(string[] args) | ||
{ | ||
var appBuilder = PhotinoBlazorAppBuilder.CreateDefault(args); | ||
|
||
appBuilder.Services | ||
.AddNitefoxServices() | ||
.AddSingleton<IFileService, PhotinoFileService>(); | ||
|
||
// register root component and selector | ||
appBuilder.RootComponents.Add<NitefoxApp>("#app"); | ||
|
||
var app = appBuilder.Build(); | ||
|
||
// customize window | ||
app.MainWindow | ||
.SetContextMenuEnabled(false) | ||
.SetIconFile("nitefox_icon.ico") | ||
.SetTitle("Nitefox"); | ||
|
||
app.MainWindow.Centered = true; | ||
app.MainWindow.GrantBrowserPermissions = true; | ||
|
||
App = app; | ||
|
||
AppDomain.CurrentDomain.UnhandledException += (sender, error) => | ||
{ | ||
app.MainWindow.ShowMessage("Fatal exception", error.ExceptionObject.ToString()); | ||
}; | ||
|
||
app.Run(); | ||
} | ||
|
||
public static PhotinoBlazorApp App { get; private set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// Copyright (C) 2023 John Russell C. Camo (@russkyc) | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY | ||
|
||
using System; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using Nitefox.App.Configuration; | ||
using Nitefox.App.Services.Interfaces; | ||
|
||
namespace Nitefox.Client.Photino.Services; | ||
|
||
public class PhotinoFileService : IFileService | ||
{ | ||
private readonly NitefoxConfig _nitefoxConfig; | ||
|
||
public PhotinoFileService(NitefoxConfig nitefoxConfig) | ||
{ | ||
_nitefoxConfig = nitefoxConfig; | ||
SetupDirectories(); | ||
} | ||
|
||
public async Task<string> OpenFolder() | ||
{ | ||
try | ||
{ | ||
var path = Program.App.MainWindow.ShowOpenFolder(); | ||
return path[0]; | ||
} | ||
catch (Exception) | ||
{ | ||
return ""; | ||
} | ||
} | ||
|
||
public bool CreateMediaDirectory(string basePath, string directoryName) | ||
{ | ||
var mediaDirectory = $"{basePath}{directoryName}\\"; | ||
|
||
if (Directory.Exists(mediaDirectory)) | ||
{ | ||
return true; | ||
} | ||
|
||
Directory.CreateDirectory(mediaDirectory); | ||
return Directory.Exists(mediaDirectory); | ||
} | ||
|
||
public void SetupDirectories() | ||
{ | ||
if (string.IsNullOrWhiteSpace(_nitefoxConfig.DownloadLocation)) | ||
{ | ||
_nitefoxConfig.DownloadLocation = Environment.CurrentDirectory + "\\songs\\"; | ||
} | ||
|
||
if (!Directory.Exists(_nitefoxConfig.DownloadLocation)) | ||
{ | ||
Directory.CreateDirectory(_nitefoxConfig.DownloadLocation); | ||
} | ||
|
||
if (string.IsNullOrWhiteSpace(_nitefoxConfig.TempFilesLocation)) | ||
{ | ||
_nitefoxConfig.TempFilesLocation = Environment.CurrentDirectory + "\\temp\\"; | ||
} | ||
|
||
if (!Directory.Exists(_nitefoxConfig.TempFilesLocation)) | ||
{ | ||
Directory.CreateDirectory(_nitefoxConfig.TempFilesLocation); | ||
} | ||
|
||
if (string.IsNullOrWhiteSpace(_nitefoxConfig.FfmpegLocation)) | ||
{ | ||
_nitefoxConfig.FfmpegLocation = Environment.CurrentDirectory + "\\ffmpeg\\"; | ||
} | ||
|
||
if (!Directory.Exists(_nitefoxConfig.FfmpegLocation)) | ||
{ | ||
Directory.CreateDirectory(_nitefoxConfig.FfmpegLocation); | ||
} | ||
} | ||
} |
Binary file not shown.
This file was deleted.
Oops, something went wrong.