2011-08-06 02:04:35 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Web;
|
|
|
|
|
using System.Web.Mvc;
|
|
|
|
|
using NzbDrone.Core.Providers.Jobs;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Web.Controllers
|
|
|
|
|
{
|
|
|
|
|
public class CommandController : Controller
|
|
|
|
|
{
|
|
|
|
|
private readonly JobProvider _jobProvider;
|
|
|
|
|
|
|
|
|
|
public CommandController(JobProvider jobProvider)
|
|
|
|
|
{
|
|
|
|
|
_jobProvider = jobProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public JsonResult RssSync()
|
|
|
|
|
{
|
|
|
|
|
_jobProvider.QueueJob(typeof(RssSyncJob));
|
2011-08-23 03:52:08 +00:00
|
|
|
|
return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet };
|
2011-08-06 02:04:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public JsonResult SyncEpisodesOnDisk(int seriesId)
|
|
|
|
|
{
|
|
|
|
|
//Syncs the episodes on disk for the specified series
|
|
|
|
|
_jobProvider.QueueJob(typeof(DiskScanJob), seriesId);
|
|
|
|
|
|
2011-08-23 03:52:08 +00:00
|
|
|
|
return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet };
|
2011-08-06 02:04:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public JsonResult UpdateInfo(int seriesId)
|
|
|
|
|
{
|
|
|
|
|
//Syncs the episodes on disk for the specified series
|
|
|
|
|
_jobProvider.QueueJob(typeof(UpdateInfoJob), seriesId);
|
|
|
|
|
|
2011-08-23 03:52:08 +00:00
|
|
|
|
return new JsonResult { Data = "ok", JsonRequestBehavior = JsonRequestBehavior.AllowGet };
|
2011-08-06 02:04:35 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|