Beispiel #1
0
 private APIResponse PostRebuildDatabase(APIRequest request)
 {
     MediaDatabase.StartRebuild();
     return(new APIResponse(JsonConvert.SerializeObject(new { description = "Starting media database rebuild" })));
 }
Beispiel #2
0
 private APIResponse PostExitRequest(APIRequest request)
 {
     Program.SignalExit();
     return(new APIResponse(JsonConvert.SerializeObject(new { description = "Shutting down XSMP" })));
 }
Beispiel #3
0
 private APIResponse PostRefreshDatabase(APIRequest request)
 {
     MediaDatabase.StartMediaScan();
     return(new APIResponse(JsonConvert.SerializeObject(new { description = "Starting media scan" })));
 }
Beispiel #4
0
        private async Task <APIResponse> GetAsync(APIRequest request)
        {
            await Task.Delay(2000);

            return(new APIResponse(JsonConvert.SerializeObject(new { status = "test", description = "Hit \"async\"" })));
        }
Beispiel #5
0
 private static APIResponse GetStatic(APIRequest request)
 {
     return(new APIResponse(JsonConvert.SerializeObject(new { status = "test", description = "Hit \"static\"" })));
 }
Beispiel #6
0
 private APIResponse GetAnyMeta(APIRequest request)
 {
     return(new APIResponse(JsonConvert.SerializeObject(new { status = "test", description = "You hit the base meta handler", segment = request.Segment })));
 }
Beispiel #7
0
 private APIResponse GetAnyStatus(APIRequest request)
 {
     return(new APIResponse(JsonConvert.SerializeObject(new { status = "test", description = "Hit \"any status\"", segment = request.Segment })));
 }
Beispiel #8
0
 private APIResponse PostSystemStatus(APIRequest request)
 {
     return(new APIResponse(JsonConvert.SerializeObject(new { status = "test", description = "Why would you ever POST status?" })));
 }
Beispiel #9
0
        private APIResponse GetFolders(APIRequest request)
        {
            var responseData = new { folders = MediaDatabase.GetRootFolders() };

            return(new APIResponse(JsonConvert.SerializeObject(new { data = responseData })));
        }
Beispiel #10
0
        private APIResponse PostFlushCache(APIRequest request)
        {
            MediaTranscoder.FlushCache();

            return(new APIResponse(JsonConvert.SerializeObject(new { description = "Media cache flushed" })));
        }