public override bool InitFromDB(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; CommandType = cq.CommandType; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields Hash = TryGetProperty(docCreator, "CommandRequest_AddFileToMyList", "Hash"); } if (Hash.Trim().Length <= 0) { return(false); } vid = RepoFactory.VideoLocal.GetByHash(Hash); return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; NumberStyles style = NumberStyles.Number; CultureInfo culture = CultureInfo.CreateSpecificCulture("en-GB"); // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields AnimeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_VoteAnime", "AnimeID")); VoteType = int.Parse(TryGetProperty(docCreator, "CommandRequest_VoteAnime", "VoteType")); VoteValue = decimal.Parse(TryGetProperty(docCreator, "CommandRequest_VoteAnime", "VoteValue"), style, culture); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields FileName = TryGetProperty(docCreator, "CommandRequest_HashFile", "FileName"); ForceHash = bool.Parse(TryGetProperty(docCreator, "CommandRequest_HashFile", "ForceHash")); } if (FileName.Trim().Length > 0) { return(true); } return(false); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields TvDBSeriesID = int.Parse(TryGetProperty(docCreator, "CommandRequest_TvDBUpdateSeries", "TvDBSeriesID")); ForceRefresh = bool.Parse(TryGetProperty(docCreator, "CommandRequest_TvDBUpdateSeries", "ForceRefresh")); SeriesTitle = TryGetProperty(docCreator, "CommandRequest_TvDBUpdateSeries", "SeriesTitle"); if (string.IsNullOrEmpty(SeriesTitle)) { SeriesTitle = RepoFactory.TvDB_Series.GetByTvDBID(TvDBSeriesID)?.SeriesName ?? string.Intern("Name not Available"); } } return(true); }
public override bool InitFromDB(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; CommandType = cq.CommandType; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields AnimeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_GetAnimeHTTP", "AnimeID")); DownloadRelations = bool.Parse(TryGetProperty(docCreator, "CommandRequest_GetAnimeHTTP", "DownloadRelations")); ForceRefresh = bool.Parse( TryGetProperty(docCreator, "CommandRequest_GetAnimeHTTP", "ForceRefresh")); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields AnimeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_GetAnimeHTTP", "AnimeID")); if (RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID) == null) { Priority = (int)CommandRequestPriority.Priority1; } DownloadRelations = bool.Parse(TryGetProperty(docCreator, "CommandRequest_GetAnimeHTTP", "DownloadRelations")); ForceRefresh = bool.Parse( TryGetProperty(docCreator, "CommandRequest_GetAnimeHTTP", "ForceRefresh")); RelDepth = int.Parse(TryGetProperty(docCreator, nameof(CommandRequest_GetAnimeHTTP), nameof(RelDepth))); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields if (!int.TryParse(TryGetProperty(docCreator, "CommandRequest_GetFileMyListStatus", "AniFileID"), out int ID)) { return(false); } AniFileID = ID; FileName = TryGetProperty(docCreator, "CommandRequest_GetFileMyListStatus", "FileName"); } return(true); }
public override bool InitFromDB(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; CommandType = cq.CommandType; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields AnimeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTrakt", "AnimeID")); AniDBStartEpisodeType = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTrakt", "AniDBStartEpisodeType")); AniDBStartEpisodeNumber = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTrakt", "AniDBStartEpisodeNumber")); TraktID = TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTrakt", "TraktID"); TraktSeasonNumber = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTrakt", "TraktSeasonNumber")); TraktStartEpisodeNumber = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTrakt", "TraktStartEpisodeNumber")); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields Hash = TryGetProperty(docCreator, "CommandRequest_DeleteFileFromMyList", "Hash"); FileSize = long.Parse( TryGetProperty(docCreator, "CommandRequest_DeleteFileFromMyList", "FileSize")); MyListID = int.Parse(TryGetProperty(docCreator, "CommandRequest_DeleteFileFromMyList", "MyListID")); } if (Hash.Trim().Length > 0) { return(true); } return(false); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length <= 0) { return(true); } XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields VideoLocalID = int.Parse(TryGetProperty(docCreator, "CommandRequest_ProcessFile", "VideoLocalID")); ForceAniDB = bool.Parse(TryGetProperty(docCreator, "CommandRequest_ProcessFile", "ForceAniDB")); SkipMyList = bool.Parse(TryGetProperty(docCreator, "CommandRequest_ProcessFile", "SkipMyList")); vlocal = RepoFactory.VideoLocal.GetByID(VideoLocalID); return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields VideoLocalID = int.Parse(TryGetProperty(docCreator, "CommandRequest_LinkFileManually", "VideoLocalID")); EpisodeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_LinkFileManually", "EpisodeID")); Percentage = int.Parse(TryGetProperty(docCreator, "CommandRequest_LinkFileManually", "Percentage")); vlocal = RepoFactory.VideoLocal.GetByID(VideoLocalID); if (null == vlocal) { logger.Info("videolocal object {0} not found", VideoLocalID); return(false); } episode = RepoFactory.AnimeEpisode.GetByID(EpisodeID); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields animeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_LinkAniDBTvDB", "animeID")); aniEpType = (EpisodeType)Enum.Parse(typeof(EpisodeType), TryGetProperty(docCreator, "CommandRequest_LinkAniDBTvDB", "aniEpType")); aniEpNumber = int.Parse(TryGetProperty(docCreator, "CommandRequest_LinkAniDBTvDB", "aniEpNumber")); tvDBID = int.Parse(TryGetProperty(docCreator, "CommandRequest_LinkAniDBTvDB", "tvDBID")); tvSeasonNumber = int.Parse( TryGetProperty(docCreator, "CommandRequest_LinkAniDBTvDB", "tvSeasonNumber")); tvEpNumber = int.Parse(TryGetProperty(docCreator, "CommandRequest_LinkAniDBTvDB", "tvEpNumber")); excludeFromWebCache = bool.Parse( TryGetProperty(docCreator, "CommandRequest_LinkAniDBTvDB", "excludeFromWebCache")); additiveLink = bool.Parse( TryGetProperty(docCreator, "CommandRequest_LinkAniDBTvDB", "additiveLink")); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields Hash = TryGetProperty(docCreator, "CommandRequest_AddFileToMyList", "Hash"); string read = TryGetProperty(docCreator, "CommandRequest_AddFileToMyList", "ReadStates"); if (!bool.TryParse(read, out bool read_states)) { read_states = true; } ReadStates = read_states; } if (Hash.Trim().Length <= 0) { return(false); } vid = RepoFactory.VideoLocal.GetByHash(Hash); return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields TvDBEpisodeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_TvDBUpdateEpisode", "TvDBEpisodeID")); ForceRefresh = bool.Parse(TryGetProperty(docCreator, "CommandRequest_TvDBUpdateEpisode", "ForceRefresh")); DownloadImages = bool.Parse(TryGetProperty(docCreator, "CommandRequest_TvDBUpdateEpisode", "DownloadImages")); InfoString = TryGetProperty(docCreator, "CommandRequest_TvDBUpdateEpisode", "InfoString"); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); } return(true); }
public override bool InitFromDB(CommandRequest cq) { try { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; CommandType = cq.CommandType; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields AnimeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTvDB", "AnimeID")); AniDBStartEpisodeType = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTvDB", "AniDBStartEpisodeType")); AniDBStartEpisodeNumber = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTvDB", "AniDBStartEpisodeNumber")); TvDBID = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTvDB", "TvDBID")); TvDBSeasonNumber = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTvDB", "TvDBSeasonNumber")); TvDBStartEpisodeNumber = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefAniDBTvDB", "TvDBStartEpisodeNumber")); } } catch (Exception ex) { logger.Error(ex, "Error processing CommandRequest_WebCacheDeleteXRefAniDBTvDB: {0}" + ex); return(true); } return(true); }
public override bool InitFromDB(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; CommandType = cq.CommandType; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields Hash = TryGetProperty(docCreator, "CommandRequest_UpdateMyListFileStatus", "Hash"); Watched = bool.Parse( TryGetProperty(docCreator, "CommandRequest_UpdateMyListFileStatus", "Watched")); string sUpStats = TryGetProperty(docCreator, "CommandRequest_UpdateMyListFileStatus", "UpdateSeriesStats"); if (bool.TryParse(sUpStats, out bool upStats)) { UpdateSeriesStats = upStats; } if ( int.TryParse( TryGetProperty(docCreator, "CommandRequest_UpdateMyListFileStatus", "WatchedDateAsSecs"), out int dateSecs)) { WatchedDateAsSecs = dateSecs; } FullFileName = RepoFactory.FileNameHash.GetByHash(Hash).FirstOrDefault()?.FileName; } if (Hash.Trim().Length > 0) { return(true); } return(false); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields AnimeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_Azure_SendAnimeXML", "AnimeID")); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields TraktID = TryGetProperty(docCreator, "CommandRequest_TraktUpdateInfoAndImages", "TraktID"); } return(true); }
public override bool InitFromDB(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; CommandType = cq.CommandType; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields Username = TryGetProperty(docCreator, "CommandRequest_Azure_SendUserInfo", "Username"); } return(true); }
public override bool InitFromDB(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; CommandType = cq.CommandType; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields EpisodeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_GetEpisode", "EpisodeID")); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; CommandType = cq.CommandType; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields ForceRefresh = bool.Parse(TryGetProperty(docCreator, "CommandRequest_SyncMyList", "ForceRefresh")); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields AnimeID = int.Parse(TryGetProperty(docCreator, nameof(CommandRequest_GetAnimeHTTP), nameof(AnimeID))); if (RepoFactory.AniDB_Anime.GetByAnimeID(AnimeID) == null) { Priority = (int)CommandRequestPriority.Priority1; } if (bool.TryParse(TryGetProperty(docCreator, nameof(CommandRequest_GetAnimeHTTP), nameof(DownloadRelations)), out var dlRelations)) { DownloadRelations = dlRelations; } if (bool.TryParse(TryGetProperty(docCreator, nameof(CommandRequest_GetAnimeHTTP), nameof(ForceRefresh)), out var force)) { ForceRefresh = force; } if (int.TryParse(TryGetProperty(docCreator, nameof(CommandRequest_GetAnimeHTTP), nameof(RelDepth)), out var depth)) { RelDepth = depth; } if (bool.TryParse(TryGetProperty(docCreator, nameof(CommandRequest_GetAnimeHTTP), nameof(CreateSeriesEntry)), out var create)) { CreateSeriesEntry = create; } } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields Hash = TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefFileEpisode", "Hash"); EpisodeID = int.Parse(TryGetProperty(docCreator, "CommandRequest_WebCacheDeleteXRefFileEpisode", "EpisodeID")); } return(true); }
public override bool InitFromDB(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; CommandType = cq.CommandType; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields AnimeSeriesID = int.Parse(TryGetProperty(docCreator, "CommandRequest_TraktSyncCollectionSeries", "AnimeSeriesID")); SeriesName = TryGetProperty(docCreator, "CommandRequest_TraktSyncCollectionSeries", "SeriesName"); } return(true); }
public override bool LoadFromDBCommand(CommandRequest cq) { CommandID = cq.CommandID; CommandRequestID = cq.CommandRequestID; Priority = cq.Priority; CommandDetails = cq.CommandDetails; DateTimeUpdated = cq.DateTimeUpdated; // read xml to get parameters if (CommandDetails.Trim().Length > 0) { XmlDocument docCreator = new XmlDocument(); docCreator.LoadXml(CommandDetails); // populate the fields EntityID = int.Parse(TryGetProperty(docCreator, "CommandRequest_DownloadImage", "EntityID")); EntityType = int.Parse(TryGetProperty(docCreator, "CommandRequest_DownloadImage", "EntityType")); ForceDownload = bool.Parse(TryGetProperty(docCreator, "CommandRequest_DownloadImage", "ForceDownload")); } return(true); }