-
Notifications
You must be signed in to change notification settings - Fork 4
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
5 changed files
with
68 additions
and
12 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
34 changes: 34 additions & 0 deletions
34
SynologyDotNet.AudioStation/AudioStationClient.Management.cs
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,34 @@ | ||
using System.Threading.Tasks; | ||
using SynologyDotNet.AudioStation.Model; | ||
using SynologyDotNet.Core.Helpers; | ||
using SynologyDotNet.Core.Responses; | ||
|
||
namespace SynologyDotNet.AudioStation | ||
{ | ||
public partial class AudioStationClient | ||
{ | ||
private const string UsermanEndpoint = "webman/3rdparty/AudioStation/webUI/audio_userman.cgi"; | ||
|
||
/// <summary> | ||
/// Starts indexing service to update audio library. | ||
/// </summary> | ||
/// <returns></returns> | ||
public async Task<ApiResponse> StartReIndex() | ||
{ | ||
var req = new RequestBuilder().SetEndpoint(UsermanEndpoint); | ||
req["action"] = "do_reindex"; | ||
return await Client.QueryObjectAsync<ApiResponse>(req); | ||
} | ||
|
||
/// <summary> | ||
/// Gets the state of the indexing service. | ||
/// </summary> | ||
/// <returns></returns> | ||
public async Task<ReIndexStateResponse> GetReIndexState() | ||
{ | ||
var req = new RequestBuilder().SetEndpoint(UsermanEndpoint); | ||
req["action"] = "load_reindex"; | ||
return await Client.QueryObjectAsync<ReIndexStateResponse>(req); | ||
} | ||
} | ||
} |
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,11 @@ | ||
using Newtonsoft.Json; | ||
using SynologyDotNet.Core.Responses; | ||
|
||
namespace SynologyDotNet.AudioStation.Model | ||
{ | ||
public class ReIndexStateResponse : ApiResponse | ||
{ | ||
[JsonProperty("reindexing")] | ||
public bool ReIndexing { get; set; } | ||
} | ||
} |