Esempio n. 1
0
        private void ctrlStreamInfo_Load(object sender, EventArgs e)
        {
            BackColor = Color.Transparent;

            VLCToolStripMenuItem.Visible = File.Exists(MainForm.pathVLC);
            MPCToolStripMenuItem.Visible = File.Exists(MainForm.pathMPCCodec64) || File.Exists(MainForm.pathMPC64) || File.Exists(MainForm.pathMPC86);

            if (isLocal == true)
            {
                infoAge.Text = MainForm.rm.GetString("local"); imgDownload.Visible = false; imgReportBroken.Visible = false; imgCopyURL.Visible = false;
            }

            // Checks for exact file name of a subtitle file that matches the one being loaded (e.g. Media File Name: 'Jigsaw.2017.mp4' > Subtitle File Name: 'Jigsaw.2017.srt' will be loaded)
            if (infoFileSubtitles == null)
            {
                if (UtilityTools.isExistingSubtitlesFile(infoFileURL) == true)
                {
                    infoFileSubtitles = MainForm.userDownloadsDirectory + Path.GetFileNameWithoutExtension(infoFileURL) + ".srt";
                }
            }

            if (UtilityTools.isSaved(UtilityTools.fileToJson(infoFileURL, infoName.Text, Path.GetExtension(infoName.Text).ToUpper().Replace(".", ""), infoAge.Text)))
            {
                imgAddToBookmarks.Image = Properties.Resources.bookmark_remove;
            }
            else
            {
                imgAddToBookmarks.Image = Properties.Resources.bookmark_plus;
            }
        }
Esempio n. 2
0
 private void btnSaveFile_ClickButtonArea(object Sender, MouseEventArgs e)
 {
     if (!UtilityTools.isSaved(UtilityTools.fileToJson(infoFileURL.Text, infoName.Text, infoType.Text, infoReferrer.Text)))
     {
         UtilityTools.saveFile(UtilityTools.fileToJson(infoFileURL.Text, infoName.Text, infoType.Text, infoReferrer.Text));
         btnSaveFile.Image = WebCrunch.Properties.Resources.bookmark_remove;
     }
     else
     {
         UtilityTools.unsaveFile(UtilityTools.fileToJson(infoFileURL.Text, infoName.Text, infoType.Text, infoReferrer.Text));
         btnSaveFile.Image = WebCrunch.Properties.Resources.bookmark_plus;
     }
 }
Esempio n. 3
0
 private void imgAddToBookmarks_Click(object sender, EventArgs e)
 {
     if (!UtilityTools.isSaved(UtilityTools.fileToJson(infoFileURL, infoName.Text, Path.GetExtension(infoName.Text).Replace(".", "").ToUpper(), infoAge.Text)))
     {
         UtilityTools.saveFile(UtilityTools.fileToJson(infoFileURL, infoName.Text, Path.GetExtension(infoName.Text).Replace(".", "").ToUpper(), infoAge.Text));
         imgAddToBookmarks.Image = Properties.Resources.bookmark_remove;
     }
     else
     {
         UtilityTools.unsaveFile(UtilityTools.fileToJson(infoFileURL, infoName.Text, Path.GetExtension(infoName.Text).Replace(".", "").ToUpper(), infoAge.Text));
         imgAddToBookmarks.Image = Properties.Resources.bookmark_plus;
     }
 }
Esempio n. 4
0
        private void ctrlFileDetails_Load(object sender, EventArgs e)
        {
            VLCToolStripMenuItem.Visible = File.Exists(MainForm.pathVLC);
            MPCToolStripMenuItem.Visible = File.Exists(MainForm.pathMPCCodec64) || File.Exists(MainForm.pathMPC64) || File.Exists(MainForm.pathMPC86);

            if (videoFileTypes.Contains(infoType.Text.ToUpper()) || audioFileTypes.Contains(infoType.Text.ToUpper()))
            {
                btnPlayMedia.Visible = true;
            }

            if (infoAge.Text == "-")
            {
                try { infoAge.Text = UtilityTools.getTimeAgo(Convert.ToDateTime(UtilityTools.getLastModifiedTime(infoFileURL.Text))); } catch { infoAge.Text = "-"; }
            }

            if (infoSize.Text == "-")
            {
                btnRequestFileSize.Visible = true;
            }

            if (infoFileSubtitles == null)
            {
                if (UtilityTools.isExistingSubtitlesFile(infoFileURL.Text) == true)
                {
                    infoFileSubtitles = MainForm.userDownloadsDirectory + Path.GetFileNameWithoutExtension(infoFileURL.Text) + ".srt";
                }
            }

            if (UtilityTools.isSaved(UtilityTools.fileToJson(infoFileURL.Text, infoName.Text, infoType.Text, infoReferrer.Text)))
            {
                btnSaveFile.Image = WebCrunch.Properties.Resources.bookmark_remove;
            }
            else
            {
                btnSaveFile.Image = WebCrunch.Properties.Resources.bookmark_plus;
            }
        }