Exemple #1
0
        private void comboLists_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (loading)
            {
                return;
            }
            currentPlaylist = comboLists.SelectedItem as JRPlaylist;
            state.Playlist  = currentPlaylist?.Name;
            if (currentPlaylist != null)
            {
                //if (currentPlaylist.Files == null)
                LoadPlaylist(currentPlaylist);
            }

            var files = currentPlaylist?.Files.OrderBy(f => f.ToString()).ToList();

            comboFiles.DataSource = files;
            if (files == null || files.Count == 0)
            {
                currentFile = null;
            }
            else
            {
                comboFiles.SelectedIndex = 0;
            }
        }
Exemple #2
0
        private void comboFiles_SelectedIndexChanged(object sender, EventArgs e)
        {
            currentFile = comboFiles.SelectedItem as JRFile;
            //if (currentFile != null)
            //    Text = $"ZELDA - {currentFile.Name} ({currentFile.Year})";
            //else
            //    Text = $"ZELDA";

            foreach (var tab in expressionTabs)
            {
                tab.Evaluate(currentFile);
            }
        }
Exemple #3
0
 public string resolveExpression(JRFile jrFile, string expression)
 {
     try
     {
         if (jr == null || jrFile == null || string.IsNullOrEmpty(expression))
         {
             return(string.Empty);
         }
         IMJFileAutomation file = jr.GetFileByKey(jrFile.JRKey);
         return(file.GetFilledTemplate(expression));
     }
     catch (Exception ex) { Logger.Log(ex, "JRiverAPI.resolveExpression()"); }
     return("[JRiver Exception!]");
 }
Exemple #4
0
        public InsertField(List <string> fields, JRFile file, JRiverAPI api)
        {
            InitializeComponent();

            Icon = Properties.Resources.ZeldaIcon;
            DataTable dt = new DataTable();

            dt.Columns.Add("field");
            dt.Columns.Add("value");
            foreach (var f in fields.OrderBy(f => f))
            {
                dt.Rows.Add(f, file[f]);
            }

            BindingSource bs = new BindingSource();

            bs.DataSource         = dt;
            gridFields.DataSource = bs;
        }
Exemple #5
0
        private JRFile getFieldValues(IMJFileAutomation file, List <string> fields = null, bool formatted = true)
        {
            lastException = null;
            try
            {
                // get fields
                Dictionary <string, string> JRfields = new Dictionary <string, string>();

                JRfields["date imported"]  = getFieldValue(file, "date imported", formatted);   // datetime / epoch
                JRfields["date (release)"] = getFieldValue(file, "date (release)", formatted);  // date / days since 1900
                JRfields["date"]           = getFieldValue(file, "date", formatted);            // date / days since 1900
                JRfields["date (year)"]    = getFieldValue(file, "date (year)", formatted);     // year

                JRfields["name"]           = getFieldValue(file, "name", formatted);
                JRfields["filename"]       = getFieldValue(file, "filename", formatted);
                JRfields["file size"]      = getFieldValue(file, "file size", formatted);
                JRfields["media sub type"] = getFieldValue(file, "media sub type", formatted);
                JRfields["media type"]     = getFieldValue(file, "media type", formatted);

                if (fields != null && fields.Count > 0)
                {
                    foreach (string f in fields)
                    {
                        if (!JRfields.ContainsKey(f.ToLower()))
                        {
                            JRfields[f.ToLower()] = getFieldValue(file, f, formatted);
                        }
                    }
                }

                JRFile info = new JRFile(file.GetKey(), JRfields);
                return(info);
            }
            catch (Exception ex)
            {
                Logger.Log(ex, "JRiverAPI.getMovieInfo()");
                lastException = ex;
            }
            return(null);
        }
Exemple #6
0
 internal void Evaluate(JRFile file)
 {
     currentFile = file;
     Evaluate();
 }