コード例 #1
0
        public void SetPickupTitle(MovieFileContents myFileContents)
        {
            MovieImportData impData = new MovieImportData(myFileContents.Name);

            string workCopyText = "";

            // クリップボードテキストから不要な削除文字列を設定する
            //List<string> listCutText = new List<string>();

            ProductNumber = impData.ProductNumber;

            if (Maker != null)
            {
                Regex regex = new Regex(Maker.MatchProductNumber);
                if (regex.IsMatch(workCopyText.Trim()))
                {
                    foreach (Match m in regex.Matches(workCopyText))
                    {
                        workCopyText = impData.Title.Replace(m.Value.ToString(), "");
                    }
                }
            }
            else
            {
                workCopyText = impData.Title;
            }

            foreach (HdInfo data in HdKindList)
            {
                Regex regex = new Regex(data.Name + "$");
                if (regex.IsMatch(workCopyText.Trim()))
                {
                    foreach (Match m in regex.Matches(workCopyText))
                    {
                        workCopyText = workCopyText.Replace(m.Value.ToString(), "");
                    }
                }
            }

            string hd = "";

            if (HdKind != null)
            {
                hd = " " + HdKind.Name;
            }

            if (workCopyText.Length > 0)
            {
                Title = workCopyText + hd;
            }
            else
            {
                Title = impData.Title + hd;
            }
        }
コード例 #2
0
        public void SetDbMovieFilesInfo(MovieImportData myImportData)
        {
            DatabaseMovieFile = new MovieFileContents();

            DatabaseMovieFile.Name  = DestFilename;
            DatabaseMovieFile.Label = LabelPath;

            foreach (string ext in listExtension)
            {
                if (ext.ToUpper().Equals(".JPG") ||
                    ext.ToUpper().Equals(".JPEG") ||
                    ext.ToUpper().Equals(".PNG") ||
                    ext.ToUpper().Equals(".ISO"))
                {
                    continue;
                }

                // 動画ファイルが複数合った場合に後ろに付加する「_1」などのために名前順に並べ替える
                var dataMatch = from seldata in listSelectedFiles
                                where seldata.FileInfo.Extension == ext
                                orderby seldata.Name ascending
                                select seldata;

                DatabaseMovieFile.Extension = ext.Replace(".", "").ToUpper();
                DatabaseMovieFile.FileCount = dataMatch.Count();

                if (dataMatch.Count() == 1)
                {
                    foreach (TargetFiles sel in dataMatch)
                    {
                        DatabaseMovieFile.Size     = sel.FileInfo.Length;
                        DatabaseMovieFile.FileDate = sel.FileInfo.LastWriteTime;
                    }
                }
                else
                {
                    long size = 0;
                    foreach (TargetFiles sel in dataMatch)
                    {
                        size += sel.FileInfo.Length;
                        DatabaseMovieFile.FileDate = sel.FileInfo.LastWriteTime;
                    }

                    DatabaseMovieFile.Size = size;
                }
            }
            // 品番、販売日を設定
            //DatabaseMovieFile.Parse();
            DatabaseMovieFile.SellDate      = myImportData.ProductDate;
            DatabaseMovieFile.ProductNumber = myImportData.ProductNumber;

            DatabaseMovieFile.Tag = myImportData.Tag;
        }