Skip to content

Commit

Permalink
Merge branch 'master' into verison-update
Browse files Browse the repository at this point in the history
  • Loading branch information
ElementalCrisis authored Oct 12, 2024
2 parents 06ccf9d + 13a57bc commit ebd18b6
Show file tree
Hide file tree
Showing 47 changed files with 282 additions and 767 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Build Daily

on:
push:
branches: [ master ]
branches:
- master
# pull_request:
# branches: [ master ]

Expand All @@ -12,7 +13,7 @@ jobs:

name: Shoko Desktop daily build
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

steps:
- uses: actions/checkout@master
Expand All @@ -32,17 +33,20 @@ jobs:
run: msbuild Shoko.Desktop.sln /p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=FolderProfile

- name: Upload Artifact
uses: actions/upload-artifact@v1.0.0
uses: actions/upload-artifact@v4.4.0
with:
name: ShokoDesktop
path: Shoko.Desktop\bin\Release

- name: Archive Release
shell: powershell
shell: pwsh
run: Compress-Archive .\\Shoko.Desktop\\bin\\Release .\\ShokoDesktop.zip

- name: Upload Daily to shokoanime.com
shell: powershell
shell: pwsh
env:
FTP_USERNAME: ${{ secrets.FTP_USERNAME }}
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
FTP_SERVER: ${{ secrets.FTP_SERVER }}
run : .\\.github\\workflows\\UploadArchive.ps1

6 changes: 2 additions & 4 deletions Installer/ShokoDesktop.iss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

AppId={{EFA49A76-085F-4E64-AEC4-6ACA707A5D91}
AppName=Shoko Desktop
AppVersion=4.2.0.0
AppVersion=4.3.0.0
AppVerName=Shoko Desktop
AppPublisher=Shoko Team
AppPublisherURL=https://ShokoAnime.com/
Expand All @@ -39,7 +39,6 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "..\..\ShokoDesktop\Installer\FixPermissions.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\Shoko.Desktop\bin\Release\net6.0-windows\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Expand All @@ -48,9 +47,8 @@ Name: "{group}\{cm:UninstallProgram,Shoko Desktop}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Shoko Desktop"; Filename: "{app}\ShokoDesktop.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\FixPermissions.bat";
Filename: "{app}\ShokoDesktop.exe"; Flags: nowait postinstall skipifsilent shellexec; Description: "{cm:LaunchProgram,Shoko Desktop}"
Filename: "https://shokoanime.com/blog/shoko-version-420-released/"; Flags: shellexec runasoriginaluser postinstall; Description: "View 4.2.0 Release Notes"
Filename: "https://shokoanime.com/blog/shoko-version-5-0-0-released/"; Flags: shellexec runasoriginaluser postinstall; Description: "View 4.3.0 Release Notes"

[Dirs]
Name: "{app}"; Permissions: users-full
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Shoko is an anime cataloging program designed to automate the cataloging of your
http://shokoanime.com/

# Learn More About Shoko Desktop
http://shokoanime.com/shoko-desktop/
[http://shokoanime.com/downloads/shoko-desktop/](https://shokoanime.com/downloads/legacy-apps/shoko-desktop)
15 changes: 15 additions & 0 deletions Shoko.Desktop/AppSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,20 @@ private static bool BaseImagesPathIsDefault
}
}

public static string JMMServer_Protocol
{
get
{
string val = Get("ShokoServer_Protocol");
if (!string.IsNullOrEmpty(val)) return val;
// default value
val = "http";
Set("ShokoServer_Protocol", val);
return val;
}
set => Set("ShokoServer_Protocol", value);
}

public static string JMMServer_Address
{
get
Expand Down Expand Up @@ -1764,6 +1778,7 @@ public static void DebugSettingsToLog()
logger.Info($"Episodes_WatchedStatus: {Episodes_WatchedStatus}");
logger.Info($"BaseImagesPath: {BaseImagesPath}");
logger.Info($"BaseImagesPathIsDefault: {BaseImagesPathIsDefault}");
logger.Info($"ShokoServer_Protocol: {JMMServer_Protocol}");
logger.Info($"ShokoServer_Address: {JMMServer_Address}");
logger.Info($"ShokoServer_Port: {JMMServer_Port}");
logger.Info($"ShokoServer_FilePort: {JMMServer_FilePort}");
Expand Down
33 changes: 16 additions & 17 deletions Shoko.Desktop/Forms/DeleteFilesForm.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,14 @@ private void HandleEsc(object sender, KeyEventArgs e)

private void HandleCheck(object sender, RoutedEventArgs e)
{
CheckBox cb = sender as CheckBox;

if (cb.Name == "cb_AutoClose_DeleteFilesForm")
if (sender is CheckBox { Name: "cb_AutoClose_DeleteFilesForm" })
{
AppSettings.AutoClose_DeleteFilesForm = true;
}
}
private void HandleUnchecked(object sender, RoutedEventArgs e)
{
CheckBox cb = sender as CheckBox;

if (cb.Name == "cb_AutoClose_DeleteFilesForm")
if (sender is CheckBox { Name: "cb_AutoClose_DeleteFilesForm" })
{
AppSettings.AutoClose_DeleteFilesForm = false;
}
Expand All @@ -149,8 +145,8 @@ void DeleteFilesForm_Closing(object sender, CancelEventArgs e)

void btnOK_Click(object sender, RoutedEventArgs e)
{
string msg = string.Format(Commons.Properties.Resources.DeleteFiles_Confirm, vids.Count);
MessageBoxResult res = MessageBox.Show(msg, Commons.Properties.Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Warning);
var msg = string.Format(Commons.Properties.Resources.DeleteFiles_Confirm, vids.SelectMany(a => a.Places).Count());
var res = MessageBox.Show(msg, Commons.Properties.Resources.Confirm, MessageBoxButton.YesNo, MessageBoxImage.Warning);

if (res == MessageBoxResult.Yes)
{
Expand Down Expand Up @@ -189,18 +185,18 @@ void deleteFilesWorker_DoWork(object sender, DoWorkEventArgs e)
{
if (vids == null) return;

int i = 0;
List<string> errors = new List<string>();
List<CL_VideoLocal_Place[]> files = vids.SelectMany(a => a.Places).GroupBy(a => Path.GetDirectoryName(a.FilePath))
var i = 0;
var errors = new List<string>();
var files = vids.SelectMany(a => a.Places).GroupBy(a => Path.GetDirectoryName(a.FilePath))
.Select(a => a.ToArray()).ToList();
int total = files.Sum(a => a.Length);
foreach (CL_VideoLocal_Place[] vid in files)
var total = files.Sum(a => a.Length);
foreach (var vid in files)
{
for (int index = 0; index < vid.Length; index++)
for (var index = 0; index < vid.Length; index++)
{
var n = vid[index];
i++;
string msg = string.Format(Commons.Properties.Resources.DeleteFiles_Deleting, i, total);
var msg = string.Format(Commons.Properties.Resources.DeleteFiles_Deleting, i, total);
deleteFilesWorker.ReportProgress(0, msg);
try
{
Expand Down Expand Up @@ -240,7 +236,9 @@ public void Init(int animeID, CL_GroupVideoQuality gvq)
{

vids = VM_ShokoServer.Instance.ShokoServices.GetFilesByGroupAndResolution(AnimeID,
GroupVideoQuality.GroupName, GroupVideoQuality.Resolution, GroupVideoQuality.VideoSource, GroupVideoQuality.VideoBitDepth, VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList<VM_VideoDetailed>();
string.IsNullOrEmpty(GroupVideoQuality.GroupName) ? "null" : GroupVideoQuality.GroupName,
GroupVideoQuality.Resolution, GroupVideoQuality.VideoSource, GroupVideoQuality.VideoBitDepth,
VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList<VM_VideoDetailed>();
FileCount = vids.Count;
lbFiles.ItemsSource = vids;
GroupName = GroupVideoQuality.GroupName;
Expand Down Expand Up @@ -268,7 +266,8 @@ public void Init(int animeID, VM_GroupFileSummary gfs)
try
{
vids = VM_ShokoServer.Instance.ShokoServices.GetFilesByGroup(AnimeID,
GroupFileSummary.GroupName, VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList<VM_VideoDetailed>();
string.IsNullOrEmpty(GroupFileSummary.GroupName) ? "null" : GroupFileSummary.GroupName,
VM_ShokoServer.Instance.CurrentUser.JMMUserID).CastList<VM_VideoDetailed>();

FileCount = vids.Count;
lbFiles.ItemsSource = vids;
Expand Down
4 changes: 3 additions & 1 deletion Shoko.Desktop/Forms/LinkPlexForm.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using MahApps.Metro.Controls;
using Shoko.Desktop.ViewModel;
using Shoko.Models.Server;
using Utils = Shoko.Desktop.Utilities.Utils;

namespace Shoko.Desktop.Forms
{
Expand Down Expand Up @@ -60,7 +62,7 @@ private void TimerOnElapsed(object sender, ElapsedEventArgs elapsedEventArgs)
private void BtnLinkOnClick(object sender, RoutedEventArgs routedEventArgs) => _vm.LinkUrl = VM_ShokoServer.Instance.ShokoServices.LoginUrl(_user.JMMUserID);

private void BtnClose_Click(object sender, RoutedEventArgs routedEventArgs) => Close();
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) => System.Diagnostics.Process.Start(e.Uri.AbsoluteUri);
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e) => Utils.OpenUrl(e.Uri.AbsoluteUri);
}

public sealed class LinkPlexVM : INotifyPropertyChanged
Expand Down
2 changes: 0 additions & 2 deletions Shoko.Desktop/Forms/MoveSeries.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@

<TextBlock Grid.Row="0" Grid.Column="0" FontWeight="Bold" Margin="5,0,5,0" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=GroupName}"/>
<TextBox Grid.Row="0" Grid.Column="1" MinWidth="300" Margin="5,0,0,5" Text="" Name="txtGroupName"/>
<TextBlock Grid.Row="1" Grid.Column="0" FontWeight="Bold" Margin="5,0,5,0" Text="{Resx ResxName=Shoko.Commons.Properties.Resources, Key=SortName}"/>
<TextBox Grid.Row="1" Grid.Column="1" MinWidth="300" Margin="5,0,0,5" Text="" Name="txtGroupSortName"/>
</Grid>
</StackPanel>

Expand Down
2 changes: 0 additions & 2 deletions Shoko.Desktop/Forms/MoveSeries.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ void btnOK_Click(object sender, RoutedEventArgs e)

VM_AnimeGroup_User grp = new VM_AnimeGroup_User();
grp.GroupName = txtGroupName.Text.Trim();
grp.SortName = txtGroupName.Text.Trim();
grp.AnimeGroupParentID = null;
grp.Description = "";
grp.IsFave = 0;
Expand Down Expand Up @@ -199,7 +198,6 @@ public void Init(VM_AnimeSeries_User series)
Series = series;

txtGroupName.Text = Series.SeriesName;
txtGroupSortName.Text = Series.SeriesName;
}

void txtGroupSearch_TextChanged(object sender, TextChangedEventArgs e)
Expand Down
8 changes: 0 additions & 8 deletions Shoko.Desktop/Forms/NewSeries.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,14 +322,6 @@ void btnCancel_Click(object sender, RoutedEventArgs e)
Close();
}

void hlURL_Click(object sender, RoutedEventArgs e)
{


//Uri uri = new Uri(string.Format(Shoko.Models.Constants.URLS.AniDB_Series, id));
//Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
}

void rbGroupNew_Checked(object sender, RoutedEventArgs e)
{
EvaluateRadioButtons();
Expand Down
4 changes: 2 additions & 2 deletions Shoko.Desktop/Forms/SearchMovieDBForm.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,13 @@ void hlURL_Click(object sender, RoutedEventArgs e)
if (id <= 0) return;

Uri uri = new Uri(string.Format(Models.Constants.URLS.MovieDB_Series, id));
Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
Utils.OpenUrl(uri.AbsoluteUri);
}

void hlURLWebCache_Click(object sender, RoutedEventArgs e)
{
Uri uri = new Uri(string.Format(Models.Constants.URLS.MovieDB_Series, CrossRef_AniDB_Other_Response.CrossRefID));
Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
Utils.OpenUrl(uri.AbsoluteUri);
}

void rbSearch_Checked(object sender, RoutedEventArgs e)
Expand Down
8 changes: 1 addition & 7 deletions Shoko.Desktop/Forms/SearchTraktForm.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,7 @@ void btnSearch_Click(object sender, RoutedEventArgs e)
void hlURL_Click(object sender, RoutedEventArgs e)
{
Uri uri = new Uri(string.Format(Constants.URLS.Trakt_Series, txtSeriesID.Text.Trim()));
Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
}

void hlURLWebCache_Click(object sender, RoutedEventArgs e)
{
//Uri uri = new Uri(string.Format(Shoko.Models.Constants.URLS.Trakt_Series, CrossRef_AniDB_TraktResult.TraktID));
//Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
Utils.OpenUrl(uri.AbsoluteUri);
}

void rbSearch_Checked(object sender, RoutedEventArgs e)
Expand Down
8 changes: 1 addition & 7 deletions Shoko.Desktop/Forms/SearchTvDBForm.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,7 @@ void hlURL_Click(object sender, RoutedEventArgs e)
if (id <= 0) return;

Uri uri = new Uri(string.Format(Constants.URLS.TvDB_Series, id));
Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
}

void hlURLWebCache_Click(object sender, RoutedEventArgs e)
{
//Uri uri = new Uri(string.Format(Shoko.Models.Constants.URLS.TvDB_Series, CrossRef_AniDB_TvDBResult.TvDBID));
//Process.Start(new ProcessStartInfo(uri.AbsoluteUri));
Utils.OpenUrl(uri.AbsoluteUri);
}

void rbSearch_Checked(object sender, RoutedEventArgs e)
Expand Down
Loading

0 comments on commit ebd18b6

Please sign in to comment.