Skip to content

Commit 6f82a26

Browse files
committed
Probably done for beta1.
1 parent a8df4fa commit 6f82a26

17 files changed

Lines changed: 1121 additions & 171 deletions

Src/MPDCtrlX/App.axaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using MPDCtrlX.Services.Contracts;
1111
using MPDCtrlX.ViewModels;
1212
using MPDCtrlX.Views;
13+
using MPDCtrlX.Views.Dialogs;
1314
using System;
1415
using System.Diagnostics;
1516
using System.Globalization;
@@ -54,6 +55,7 @@ public App()
5455
services.AddSingleton<AlbumPage>();
5556
services.AddSingleton<ArtistPage>();
5657
services.AddSingleton<SettingsPage>();
58+
services.AddTransient<InitWindow>();
5759
})
5860
.Build();
5961
}

Src/MPDCtrlX/MPDCtrlX.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
<PackageReference Include="FluentAvaloniaUI" Version="2.3.0" />
5353
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.6" />
5454
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.6" />
55+
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.7" />
5556
<PackageReference Include="Xaml.Behaviors.Avalonia" Version="11.3.2" />
5657
</ItemGroup>
5758

Src/MPDCtrlX/Models/MenuTreeBuilder.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public class NodeMenuQueue : NodeMenu
1414
{
1515
public NodeMenuQueue(string name) : base(name)
1616
{
17-
PathIcon = "M19,9H2V11H19V9M19,5H2V7H19V5M2,15H15V13H2V15M17,13V19L22,16L17,13Z";
17+
PathIcon = "M17 5.5A2.5 2.5 0 0 0 14.5 3h-9A2.5 2.5 0 0 0 3 5.5v9A2.5 2.5 0 0 0 5.5 17h4.1a5.5 5.5 0 0 1-.393-1H5.5A1.5 1.5 0 0 1 4 14.5V7h12v2.207q.524.149 1 .393zM5.5 4h9A1.5 1.5 0 0 1 16 5.5V6H4v-.5A1.5 1.5 0 0 1 5.5 4M19 14.5a4.5 4.5 0 1 1-9 0a4.5 4.5 0 0 1 9 0m-2.287-.437l-2.97-1.65a.5.5 0 0 0-.743.437v3.3a.5.5 0 0 0 .743.437l2.97-1.65a.5.5 0 0 0 0-.874";
18+
//"M19,9H2V11H19V9M19,5H2V7H19V5M2,15H15V13H2V15M17,13V19L22,16L17,13Z";
1819
}
1920
}
2021

Src/MPDCtrlX/Properties/Resources.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Src/MPDCtrlX/Properties/Resources.ja-JP.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ SOFTWARE.</value>
434434
</data>
435435
<data name="PrivacyPolicyText" xml:space="preserve">
436436
<value>MPDCtrlは、指定されたIPアドレスとオプションの認証情報を利用してネットワーク上のMPDにアクセスします。
437-
情報は、指定されたMPD以外、他へ一切送信されることは無く、設定情報はローカルのデバイスのみに保存されます。オプションの認証情報はプラットフォーム提供のスキームにより暗号化されます。</value>
437+
情報は、指定されたMPD以外、他へ一切送信されることは無く、設定情報はローカルのデバイスのみに保存されます。</value>
438438
</data>
439439
<data name="Profile" xml:space="preserve">
440440
<value>プロファイル</value>
@@ -629,6 +629,6 @@ SOFTWARE.</value>
629629
<value>プレイリストの名前を変更する</value>
630630
</data>
631631
<data name="Settings_Opts_Themes_System" xml:space="preserve">
632-
<value />
632+
<value>システム</value>
633633
</data>
634634
</root>

Src/MPDCtrlX/Properties/Resources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ SOFTWARE.</value>
433433
<value>App Privacy Policy</value>
434434
</data>
435435
<data name="PrivacyPolicyText" xml:space="preserve">
436-
<value>MPDCtrl allows you to access your music player via specified IP address with optional user credentials. None of the data is transmitted anywhere besides your specified music player and your settings are stored on your device only. Optional user credentials are encrypted with a platform provided shceme.</value>
436+
<value>MPDCtrl allows you to access your music player via specified IP address with optional user credentials. None of the data is transmitted anywhere besides your specified music player and your settings are stored on your device only.</value>
437437
</data>
438438
<data name="Profile" xml:space="preserve">
439439
<value>Profile</value>

Src/MPDCtrlX/Services/Contracts/IMpcService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public interface IMpcService
5353
Task<CommandResult> MpdDeleteId(string id);
5454
void MpdDisconnect();
5555
Task<ConnectionResult> MpdIdleConnect(string host, int port);
56-
Task<bool> MpdIdleConnectionStart(string host, int port, string password);
56+
Task<ConnectionResult> MpdIdleConnectionStart(string host, int port, string password);
5757
Task<CommandResult> MpdIdleQueryCurrentQueue();
5858
Task<CommandResult> MpdIdleQueryCurrentSong();
5959
Task<CommandResult> MpdIdleQueryListAll();

Src/MPDCtrlX/Services/MpcService.cs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ private set
161161

162162
#endregion
163163

164-
static System.Threading.SemaphoreSlim _semaphore = new System.Threading.SemaphoreSlim(1, 1);
164+
private static readonly System.Threading.SemaphoreSlim _semaphore = new(1, 1);
165165

166166
private readonly IBinaryDownloader _binaryDownloader;
167167

@@ -172,26 +172,21 @@ public MpcService(IBinaryDownloader binaryDownloader)
172172

173173
#region == Idle Connection ==
174174

175-
public async Task<bool> MpdIdleConnectionStart(string host, int port, string password)
175+
public async Task<ConnectionResult> MpdIdleConnectionStart(string host, int port, string password)
176176
{
177-
// TODO: not used for now.
178-
179177
ConnectionResult r = await MpdIdleConnect(host, port);
180178

181-
bool ret = false;
182-
183179
if (r.IsSuccess)
184180
{
185-
CommandResult d = await MpdIdleSendPassword(password);
186-
187-
if (d.IsSuccess)
181+
if (!string.IsNullOrEmpty(password))
188182
{
189-
ret = true;
183+
CommandResult d = await MpdIdleSendPassword(password);
190184

185+
r.IsSuccess = d.IsSuccess;
186+
r.ErrorMessage = d.ErrorMessage;
191187
}
192188
}
193-
194-
return ret;
189+
return r;
195190
}
196191

197192
public async Task<ConnectionResult> MpdIdleConnect(string host, int port)
@@ -1872,7 +1867,7 @@ public async Task<CommandSearchResult> MpdSearch(string queryTag, string querySh
18721867
result.SearchResult = await ParseSearchResult(cm.ResultText);
18731868
}
18741869

1875-
//MpcProgress?.Invoke(this, "");
1870+
MpcProgress?.Invoke(this, "");
18761871

18771872
return result;
18781873
}
@@ -4001,9 +3996,10 @@ private ObservableCollection<SongInfo> ParsePlaylistSongsResult(string result)
40013996
{
40023997
if (SongValues.ContainsKey("file"))
40033998
{
4004-
SongInfo sng = new();
4005-
4006-
sng.File = SongValues["file"];
3999+
SongInfo sng = new()
4000+
{
4001+
File = SongValues["file"]
4002+
};
40074003

40084004
if (string.IsNullOrEmpty(sng.File.Trim()))
40094005
{

0 commit comments

Comments
 (0)