コード例 #1
0
ファイル: CopyMoveProgress.cs プロジェクト: mudboy/tvrename
 public CopyMoveProgress(TVDoc doc, ActionQueue[] todo)
 {
     this.mDoc = doc;
     this.mToDo = todo;
     this.InitializeComponent();
     this.copyTimer.Start();
 }
コード例 #2
0
ファイル: FolderMonitor.cs プロジェクト: knackwurst/tvrename
        // private int mInternalChange;
        // private TheTVDBCodeFinder mTCCF;

        public FolderMonitor(TVDoc doc)
        {
            this.mDoc = doc;

            this.InitializeComponent();

            this.FillFolderStringLists();
        }
コード例 #3
0
ファイル: TorrentMatch.cs プロジェクト: knackwurst/tvrename
        public TorrentMatch(TVDoc doc, SetProgressDelegate prog)
        {
            this.SetProgress = prog;
            this.mDoc = doc;

            this.InitializeComponent();

            this.TabBTEnableDisable();
        }
コード例 #4
0
        public AutoFolderMonitor(TVDoc Doc,UI ui)
        {
            mDoc = Doc;
            mUI = ui;

            mScanDelayTimer = new System.Timers.Timer(1000);
            mScanDelayTimer.Elapsed += new System.Timers.ElapsedEventHandler(mScanDelayTimer_Elapsed);
            mScanDelayTimer.Stop();
        }
コード例 #5
0
ファイル: ActorsGrid.cs プロジェクト: knackwurst/tvrename
        public ActorsGrid(TVDoc doc)
        {
            this.Internal = 0;

            this.InitializeComponent();

            this.mDoc = doc;

            this.BuildData();
            this.DoSort();
        }
コード例 #6
0
ファイル: IgnoreEdit.cs プロジェクト: mudboy/tvrename
        public IgnoreEdit(TVDoc doc)
        {
            this.mDoc = doc;
            this.Ignore = new System.Collections.Generic.List<IgnoreItem>();

            foreach (IgnoreItem ii in this.mDoc.Ignore)
                this.Ignore.Add(ii);

            this.InitializeComponent();

            this.FillList();
        }
コード例 #7
0
ファイル: Preferences.cs プロジェクト: knackwurst/tvrename
        public Preferences(TVDoc doc, bool goToScanOpts)
        {
            this.InitializeComponent();
            this.LoadLanguageDone += this.LoadLanguageDoneFunc;

            this.SetupRSSGrid();
            this.SetupReplacementsGrid();

            this.mDoc = doc;

            if (goToScanOpts)
                this.tabControl1.SelectedTab = this.tpScanOptions;
        }
コード例 #8
0
        public CustomNameDesigner(List<ProcessedEpisode> pel, CustomName cn, TVDoc doc)
        {
            this.Eps = pel;
            this.CN = cn;
            this.mDoc = doc;

            this.InitializeComponent();

            if (this.Eps == null)
                this.lvTest.Enabled = false;
            this.txtTemplate.Text = this.CN.StyleString;

            this.FillExamples();
            this.FillCombos();
        }
コード例 #9
0
ファイル: uTorrent.cs プロジェクト: mudboy/tvrename
        public uTorrent(TVDoc doc, SetProgressDelegate progdel)
        {
            this.mDoc = doc;
            this.SetProg = progdel;

            this.InitializeComponent();

            this.watcher.Error += this.WatcherError;

            bool en = false;
            // are there any missing items in the to-do list?
            foreach (Item i in this.mDoc.TheActionList)
            {
                if (i is ItemMissing)
                {
                    en = true;
                    break;
                }
            }
            this.cbUTMatchMissing.Enabled = en;
            this.EnableDisable();

            this.bnUTRefresh_Click(null, null);
        }
コード例 #10
0
ファイル: SABnzbdFinder.cs プロジェクト: knackwurst/tvrename
 public SABnzbdFinder(TVDoc i) : base(i) { }
コード例 #11
0
ファイル: Program.cs プロジェクト: knackwurst/tvrename
    private static int Main(string[] args)
    {
        // Enabling Windows XP visual effects before any controls are created
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        
        // Sort out the command line arguments
        CommandLineArgs clargs = new CommandLineArgs(args);

        // see if we're already running
        bool createdNew = false;
        System.Threading.Mutex mutex = new System.Threading.Mutex(true, "TVRenameMutex", out createdNew);

        if (!createdNew)
        {
            // we're already running

            // tell the already running copy to come to the foreground
            IpcClientChannel clientChannel = new IpcClientChannel();
            ChannelServices.RegisterChannel(clientChannel, true);

            RemotingConfiguration.RegisterWellKnownClientType(typeof (IPCMethods), "ipc://TVRenameChannel/IPCMethods");

            IPCMethods ipc = new IPCMethods();

            // if we were already running, and no command line arguments, then bring application to the foreground
            // and we're done.
            if (args.Length == 0)
            {
                ipc.BringToForeground();
                return 0;
            }

            // Send command-line arguments to already running TVRename via IPC

            CommandLineArgs.MissingFolderBehaviour before = ipc.MissingBehaviour;
            bool renameBefore = ipc.RenameBehaviour;

            if (clargs.RenameCheck == false)
             {
              // Temporarily override behaviour for missing folders
              ipc.RenameBehaviour = false;
            }

            if (clargs.MissingFolder != CommandLineArgs.MissingFolderBehaviour.Ask)
            {
                // Temporarily override behaviour for missing folders
                ipc.MissingBehaviour = clargs.MissingFolder;
            }

            // TODO: Unify command line handling between here and in UI.cs (ProcessArgs).  Just send in clargs via IPC?

            if (clargs.Scan || clargs.DoAll) // doall implies scan
                ipc.Scan();

            if (clargs.DoAll)
                ipc.DoAll();

            if (clargs.Quit)
            {
                ipc.Quit();
                return 0;
            }

            ipc.RenameBehaviour = renameBefore;
            ipc.MissingBehaviour = before;

        return 0;
        }

#if !DEBUG
		try
		{
#endif

        // Starting TVRename...

        // Check arguments for forced recover
        bool ok = true;
        string recoverText = "";

        if (clargs.ForceRecover)
        {
            ok = false; // force recover dialog
            recoverText = "Recover manually requested.";
        }

        // Load settings files
        TVDoc doc = null;
        try
        {
            if (!string.IsNullOrEmpty(clargs.UserFilePath))
                PathManager.SetUserDefinedBasePath(clargs.UserFilePath);
        }
        catch (System.Exception ex)
        {
            MessageBox.Show("Error while setting the User-Defined File Path:" + Environment.NewLine + ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            Environment.Exit(1);
        }

        FileInfo tvdbFile = PathManager.TVDBFile;
        FileInfo settingsFile = PathManager.TVDocSettingsFile;

        do // loop until no problems loading settings & tvdb cache files
        {
            if (!ok) // something went wrong last time around, ask the user what to do
            {
                RecoverXML rec = new RecoverXML(recoverText);
                if (rec.ShowDialog() == DialogResult.OK)
                {
                    tvdbFile = rec.DBFile;
                    settingsFile = rec.SettingsFile;
                }
                else
                    return 1;
            }

            // try loading using current settings files, and set up the main
            // classes
            TheTVDB.Instance.setup(tvdbFile, PathManager.TVDBFile, clargs);

            doc = new TVDoc(settingsFile, clargs);

            if (!ok)
                doc.SetDirty();

            ok = doc.LoadOK;

            if (!ok)
            {
                recoverText = "";
                if (!doc.LoadOK && !String.IsNullOrEmpty(doc.LoadErr))
                    recoverText += doc.LoadErr;
                if (!TheTVDB.Instance.LoadOK && !String.IsNullOrEmpty(TheTVDB.Instance.LoadErr))
                    recoverText += "\r\n" + TheTVDB.Instance.LoadErr;
            }
        } while (!ok);

        // Show user interface
        UI theUI = new UI(doc);
        Application.Run(theUI);
        GC.KeepAlive(mutex);

#if !DEBUG
		}
		catch (Exception e)
		{
		  ShowException se = new ShowException(e);
		  se.ShowDialog();
		}
#endif

        return 0;
    }
コード例 #12
0
ファイル: DownloadProgress.cs プロジェクト: mudboy/tvrename
        public DownloadProgress(TVDoc doc)
        {
            this.InitializeComponent();

            this.mDoc = doc;
        }
コード例 #13
0
ファイル: Finder.cs プロジェクト: knackwurst/tvrename
 public Finder(TVDoc doc)
 {
     this.mDoc = doc;
 }
コード例 #14
0
ファイル: FileFinder.cs プロジェクト: knackwurst/tvrename
 public FileFinder(TVDoc i) : base(i) { }
コード例 #15
0
 public FilenameMovieCheck([NotNull] MovieConfiguration movie, TVDoc doc) : base(movie, doc)
 {
 }
コード例 #16
0
 public CustomLanguageTvShowCheck([NotNull] ShowConfiguration show, TVDoc doc) : base(show, doc)
 {
 }
コード例 #17
0
 public FindMissingEpisodesLocally(TVDoc doc) : base(doc)
 {
 }
コード例 #18
0
        public static List <ShowItem> FindShows([NotNull] List <string> possibleShowNames, TVDoc doc)
        {
            List <ShowItem> addedShows = new List <ShowItem>();

            foreach (string hint in possibleShowNames)
            {
                //if hint doesn't match existing added shows
                if (LookForSeries(hint, addedShows))
                {
                    Logger.Info($"Ignoring {hint} as it matches existing shows.");
                    continue;
                }

                //If the hint contains certain terms then we'll ignore it
                if (IgnoreHint(hint))
                {
                    Logger.Info($"Ignoring {hint} as it is in the ignore list (from Settings).");
                    continue;
                }

                //If the hint contains certain terms then we'll ignore it
                if (TVSettings.Instance.IgnoredAutoAddHints.Contains(hint))
                {
                    Logger.Info(
                        $"Ignoring {hint} as it is in the list of ignored terms the user has selected to ignore from prior Auto Adds.");

                    continue;
                }

                //Remove any (nnnn) in the hint - probably a year
                string refinedHint = Regex.Replace(hint, @"\(\d{4}\)", "");

                //Remove anything we can from hint to make it cleaner and hence more likely to match
                refinedHint = RemoveSeriesEpisodeIndicators(refinedHint, doc.Library.SeasonWords());

                if (string.IsNullOrWhiteSpace(refinedHint))
                {
                    Logger.Info($"Ignoring {hint} as it refines to nothing.");
                    continue;
                }

                //If there are no LibraryFolders then we cant use the simplified UI
                if (TVSettings.Instance.LibraryFolders.Count == 0)
                {
                    MessageBox.Show(
                        "Please add some monitor (library) folders under 'Bulk Add Shows' to use the 'Auto Add' functionity (Alternatively you can add them or turn it off in settings).",
                        "Can't Auto Add Show", MessageBoxButtons.OK, MessageBoxIcon.Error);

                    continue;
                }

                Logger.Info("****************");
                Logger.Info("Auto Adding New Show");

                //popup dialog
                AutoAddShow askForMatch = new AutoAddShow(refinedHint);

                DialogResult dr = askForMatch.ShowDialog();
                if (dr == DialogResult.OK)
                {
                    //If added add show to collection
                    addedShows.Add(askForMatch.ShowItem);
                }
                else if (dr == DialogResult.Abort)
                {
                    Logger.Info("Skippng Auto Add Process");
                    break;
                }
                else if (dr == DialogResult.Ignore)
                {
                    Logger.Info($"Permenantly Ignoring 'Auto Add' for: {hint}");
                    TVSettings.Instance.IgnoredAutoAddHints.Add(hint);
                }
                else
                {
                    Logger.Info($"Cancelled Auto adding new show {hint}");
                }
            }

            return(addedShows);
        }
コード例 #19
0
 public static bool BetterShowsMatch(FileInfo matchedFile, ShowItem currentlyMatchedShow, bool useFullPath, [NotNull] TVDoc doc)
 {
     return(doc.Library.Shows
            .Where(item => item.NameMatch(matchedFile, useFullPath))
            .Where(item => item.TvdbCode != currentlyMatchedShow.TvdbCode)
            .Any(testShow => testShow.ShowName.Contains(currentlyMatchedShow.ShowName)));
 }
コード例 #20
0
 public CleanDownloadDirectory(TVDoc doc) : base(doc)
 {
 }
コード例 #21
0
 public SubdirectoryMovieCheck([NotNull] MovieConfiguration movie, TVDoc doc) : base(movie, doc)
 {
 }
コード例 #22
0
 public CheckAllFoldersExist(TVDoc doc) : base(doc)
 {
 }
コード例 #23
0
 private void bnBTSecondOpen_Click(object sender, System.EventArgs e)
 {
     TVDoc.SysOpen(this.txtBTSecondLocation.Text);
 }
コード例 #24
0
 protected ScanActivity(TVDoc doc) => MDoc = doc;
コード例 #25
0
ファイル: UpcomingRSS.cs プロジェクト: knackwurst/tvrename
 public UpcomingRSS(TVDoc i) : base(i) { }
コード例 #26
0
ファイル: UpcomingPopup.cs プロジェクト: sauv0168/tvrename
 public UpcomingPopup(TVDoc doc)
 {
     mDoc = doc;
     InitializeComponent();
 }
コード例 #27
0
ファイル: UpcomingPopup.cs プロジェクト: mudboy/tvrename
 public UpcomingPopup(TVDoc doc)
 {
     this.mDoc = doc;
     this.InitializeComponent();
 }
コード例 #28
0
 public BulkAddSeriesManager(TVDoc doc)
 {
     AddItems = new FolderMonitorEntryList();
     mDoc     = doc;
 }
コード例 #29
0
ファイル: UpcomingXML.cs プロジェクト: knackwurst/tvrename
 public UpcomingXML(TVDoc i) : base(i) { }
コード例 #30
0
ファイル: UpcomingRSS.cs プロジェクト: sauv0168/tvrename
 public UpcomingRSS(TVDoc i) : base(i)
 {
 }
コード例 #31
0
ファイル: Exporter.cs プロジェクト: knackwurst/tvrename
 public UpcomingExporter(TVDoc doc)
 {
     this.mDoc = doc;
 }
コード例 #32
0
ファイル: Server.cs プロジェクト: mudboy/tvrename
 public string ProcessLine(string line, TVDoc doc)
 {
     string[] parts = line.Split(' ');
     if (parts.Length != 3)
         return "";
     if (parts[0].ToUpper() != "GET")
         return "";
     if (parts[1].EndsWith("/upcoming.xml"))
     {
         MemoryStream ms = new MemoryStream();
         doc.GenerateUpcomingXML(ms, doc.NextNShows(doc.Settings.ExportRSSMaxShows, doc.Settings.ExportRSSDaysPast, doc.Settings.ExportRSSMaxDays));
         return System.Text.Encoding.ASCII.GetString(ms.ToArray());
     }
     return Err();
 }
コード例 #33
0
ファイル: IPC.cs プロジェクト: knackwurst/tvrename
 public static void Setup(UI ui, TVDoc doc)
 {
     TheDoc = doc;
     TheUI = ui;
 }
コード例 #34
0
ファイル: BugReport.cs プロジェクト: mudboy/tvrename
 public BugReport(TVDoc doc)
 {
     this.mDoc = doc;
     this.InitializeComponent();
 }
コード例 #35
0
ファイル: RSSFinder.cs プロジェクト: Rudu-be/tvrename
        public bool ReadItem(XmlReader r)
        {
            string title       = "";
            string link        = "";
            string description = "";

            r.Read();
            r.Read();
            while (!r.EOF)
            {
                if ((r.Name == "item") && (!r.IsStartElement()))
                {
                    break;
                }
                if (r.Name == "title")
                {
                    title = r.ReadElementContentAsString();
                }
                else if (r.Name == "description")
                {
                    description = r.ReadElementContentAsString();
                }
                else if ((r.Name == "link") && (string.IsNullOrEmpty(link)))
                {
                    link = r.ReadElementContentAsString();
                }
                else if ((r.Name == "enclosure") && (r.GetAttribute("type") == "application/x-bittorrent"))
                {
                    link = r.GetAttribute("url");
                    r.ReadOuterXml();
                }
                else
                {
                    r.ReadOuterXml();
                }
            }
            if ((string.IsNullOrEmpty(title)) || (string.IsNullOrEmpty(link)))
            {
                return(false);
            }

            int    season   = -1;
            int    episode  = -1;
            string showName = "";

            TVDoc.FindSeasEp("", title, out season, out episode, null, this.Rexps);

            try
            {
                Match m = Regex.Match(description, "Show Name: (.*?)[;|$]", RegexOptions.IgnoreCase);
                if (m.Success)
                {
                    showName = m.Groups[1].ToString();
                }
                m = Regex.Match(description, "Season: ([0-9]+)", RegexOptions.IgnoreCase);
                if (m.Success)
                {
                    season = int.Parse(m.Groups[1].ToString());
                }
                m = Regex.Match(description, "Episode: ([0-9]+)", RegexOptions.IgnoreCase);
                if (m.Success)
                {
                    episode = int.Parse(m.Groups[1].ToString());
                }
            }
            catch
            {
            }

            if ((season != -1) && (episode != -1))
            {
                this.Add(new RSSItem(link, title, season, episode, showName));
            }

            return(true);
        }
コード例 #36
0
 public MovieProviderCheck([NotNull] MovieConfiguration movie, TVDoc doc) : base(movie, doc)
 {
 }
コード例 #37
0
ファイル: RSSFinder.cs プロジェクト: Rudu-be/tvrename
 public RSSFinder(TVDoc i) : base(i)
 {
 }
コード例 #38
0
ファイル: Server.cs プロジェクト: knackwurst/tvrename
 public string ProcessLine(string line, TVDoc doc)
 {
     string[] parts = line.Split(' ');
     if (parts.Length != 3)
         return "";
     if (parts[0].ToUpper() != "GET")
         return "";
     if (parts[1].EndsWith("/upcoming.xml"))
     {
         UpcomingXML uXML = new UpcomingXML(doc);
         return uXML.produce();
     }
     return Err();
 }
コード例 #39
0
 private void bnBTOpenFolder_Click(object sender, System.EventArgs e)
 {
     TVDoc.SysOpen(this.txtFolder.Text);
 }
コード例 #40
0
ファイル: Server.cs プロジェクト: knackwurst/tvrename
        public TVRenameServer(TVDoc doc)
        {
            for (;;)
            {
                try
                {
                    // Set the TcpListener on port 13000.
                    Int32 port = 8085;
                    IPAddress localAddr = IPAddress.Parse("127.0.0.1");

                    TcpListener server = new TcpListener(localAddr, port);

                    // Start listening for client requests.
                    server.Start();

                    // Buffer for reading data
                    Byte[] bytes = new Byte[256];
                    string data = null;

                    // Enter the listening loop.
                    while (true)
                    {
                        // Perform a blocking call to accept requests.
                        // You could also user server.AcceptSocket() here.
                        TcpClient client = server.AcceptTcpClient();
                        data = null;

                        // Get a stream Object* for reading and writing
                        NetworkStream stream = client.GetStream();
                        Int32 i;

                        // Loop to receive all the data sent by the client.
                        string line = "";
                        string getLine = "";
                        bool done = false;
                        while (!done && ((i = stream.Read(bytes, 0, bytes.Length)) > 0))
                        {
                            // Translate data bytes to a ASCII String*.
                            data = System.Text.Encoding.ASCII.GetString(bytes, 0, i);

                            for (int p = 0; p < data.Length; p++)
                            {
                                char c = data[p];
                                if ((c == 0x0d) || (c == 0x0a))
                                {
                                    if ((c == 0x0d) && ((p + 1) < data.Length) && (data[p + 1] == 0x0a))
                                        p++; // skip LF following CR

                                    if (line.Length > 0)
                                    {
                                        if (line.Substring(0, 4).ToUpper() == "GET ")
                                            getLine = line;
                                    }
                                    else
                                    {
                                        if (!string.IsNullOrEmpty(getLine)) // this line is blank, and we have a GET line saved
                                        {
                                            string res = this.ProcessLine(getLine, doc);
                                            Byte[] msg = System.Text.Encoding.ASCII.GetBytes(res);
                                            stream.Write(msg, 0, msg.Length);
                                            getLine = "";
                                            done = true;
                                            break;
                                        }
                                    }

                                    line = "";
                                }
                                else
                                    line += c;
                            }
                        }
                        client.Close(); // Shutdown and end connection
                    }
                } // try
                catch (SocketException e)
                {
                    System.Windows.Forms.MessageBox.Show(e.ToString());
                }
                catch (ThreadAbortException)
                {
                    // time to stop

                    return; // we're outta here!
                }
            } // loop forever
        }
コード例 #41
0
ファイル: uTorrentFinder.cs プロジェクト: knackwurst/tvrename
 public uTorrentFinder(TVDoc i) : base(i) { }
コード例 #42
0
 protected ScanMovieActivity([NotNull] TVDoc doc) : base(doc)
 {
 }
コード例 #43
0
ファイル: UI.cs プロジェクト: madams74/tvrename
        public UI(TVDoc doc)
        {
            this.mDoc = doc;

            this.Busy = 0;
            this.mLastEpClicked = null;
            this.mLastFolderClicked = null;
            this.mLastSeasonClicked = null;
            this.mLastShowsClicked = null;
            this.mLastActionsClicked = null;

            this.mInternalChange = 0;
            this.mFoldersToOpen = new List<String>();

            this.InternalCheckChange = false;

            this.InitializeComponent();

            this.SetupIPC();

            try
            {
                this.LoadLayoutXML();
            }
            catch
            {
                // silently fail, doesn't matter too much
            }

            this.SetProgress += this.SetProgressActual;

            this.lvWhenToWatch.ListViewItemSorter = new DateSorterWTW();

            if (this.mDoc.Args.Hide)
            {
                this.WindowState = FormWindowState.Minimized;
                this.Visible = false;
                this.Hide();
            }

            this.Text = this.Text + " " + Version.DisplayVersionString();

            this.FillMyShows();
            this.UpdateSearchButton();
            this.SetGuideHTMLbody("");
            this.mDoc.DoWhenToWatch(true);
            this.FillWhenToWatchList();
            this.mDoc.WriteUpcomingRSSandXML();
            this.ShowHideNotificationIcon();

            int t = this.mDoc.Settings.StartupTab;
            if (t < this.tabControl1.TabCount)
                this.tabControl1.SelectedIndex = this.mDoc.Settings.StartupTab;
            this.tabControl1_SelectedIndexChanged(null, null);

            this.mAutoFolderMonitor = new TVRename.AutoFolderMonitor(mDoc,this);
            if (this.mDoc.Settings.MonitorFolders)
                this.mAutoFolderMonitor.StartMonitor();


        }
コード例 #44
0
ファイル: UpcomingExporter.cs プロジェクト: Abithdas/tvrename
 protected UpcomingExporter(TVDoc doc)
 {
     this.doc = doc;
 }