当前位置: 首页>>代码示例>>C#>>正文


C# IMLItem类代码示例

本文整理汇总了C#中IMLItem的典型用法代码示例。如果您正苦于以下问题:C# IMLItem类的具体用法?C# IMLItem怎么用?C# IMLItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IMLItem类属于命名空间,在下文中一共展示了IMLItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetUpdateFlag

        //REFACTOR: 
        internal static void SetUpdateFlag(IMLItem item)
        {



            if (String.IsNullOrEmpty
                    (Helpers.GetTagValueFromItem
                         (item, "ImdbID")))
            {
                ClearProcessedFlag(item);
                return;
            }



            if (String.IsNullOrEmpty
                    (Helpers.GetTagValueFromItem
                         (item, "Year")))
            {
                ClearProcessedFlag(item);
                return;
            }



            if (String.IsNullOrEmpty
                    (Helpers.GetTagValueFromItem
                         (item, "Title")))
            {
                ClearProcessedFlag(item);
                return;
            }



            if (String.IsNullOrEmpty
                (Helpers.GetTagValueFromItem
                     (item, "OriginalTitle")))
            {
                ClearProcessedFlag(item);
                return;
            }
                

            if (String.IsNullOrEmpty
                (Helpers.GetTagValueFromItem
                     (item, "SortTitle")))
            {
                ClearProcessedFlag(item);
                return;
            }
                   


            item.Tags["E.F.I.-processed"]
                = "--processed--";
                
            item.SaveTags();
            
        }
开发者ID:stavrossk,项目名称:Easy_Film_Importer_for_MeediOS,代码行数:61,代码来源:SetFilmItemProcessingFlags.cs

示例2: ConstructMoveLocation

        private static bool ConstructMoveLocation(IMLItem item, 
            string extension, out string locationToMove)
        {

            bool cancelMoving;

            if (!Settings.SortingDestinationMusic.EndsWith(@"\"))
                Settings.SortingDestinationMusic = Settings.SortingDestinationMusic + @"\";


            string directoryToMove = ConstructMoveDirectory
                (item, out cancelMoving);


            string newFilename;

            if (ConstructNewFilename(item, out newFilename))
            {
                locationToMove = null;
                return true;
            }


            if (!directoryToMove.EndsWith(@"\"))
                directoryToMove = directoryToMove + @"\";


            locationToMove = directoryToMove +
                             newFilename + extension;


            return cancelMoving;

        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:34,代码来源:MusicTrackItemUpdaterHelpers.cs

示例3: DownloadSeriesInformation

        internal static void DownloadSeriesInformation(IMLItem item, string parentDir,
            ref string seriesName, ref string seriesID, bool fileServerIsOnline,
            bool isUNC, TVDBLib tvdb,string mdfSettingsb, IBaseSystem iBaseSystem )
        {


            if (String.IsNullOrEmpty(seriesName))
                return;

            WebClient client = new WebClient();
            bool foundSeries;

            TVdbTvEpisodeDetailsDownloaderHelpers.NormalizeSeriesName(ref seriesName);


            if (TVdbTvEpisodeDetailsDownloaderHelpers.GetSeriesMatchFromSectionOrTVDb(item, ref seriesName, out seriesID,
                tvdb, mdfSettingsb, iBaseSystem, out foundSeries))
                return;


            GetEpisodeKeysFromItemTagsAndPopulateEpisodeMetadata(item, seriesName, 
                seriesID, fileServerIsOnline, isUNC, tvdb, mdfSettingsb,
                iBaseSystem, client, foundSeries);
     
        
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:26,代码来源:TVDbTvEpisodeDetailsDownloader.cs

示例4: ApplyRulesToItem

 public void ApplyRulesToItem(IMLItem item)
 {
     foreach (ReplacementRulesGroup group in this.ruleGroups)
     {
         group.ApplyRulesToItem(item);
     }
 }
开发者ID:stavrossk,项目名称:File_Importer_for_MeediOS,代码行数:7,代码来源:ReplacementRules.cs

示例5: SaveXmlDocument

        internal static bool WriteMovieDescriptor
            (IMLItem item, string itemTitle,
             string imdbid, string filmFolder,
             bool fileServerIsOnline, bool isUNC)
        {

            string movieHash = Helpers.GetTagValueFromItem(item, "Hash");
            string title = Helpers.GetTagValueFromItem(item, "Title");


            if (!ReturnCases(fileServerIsOnline, isUNC, title, movieHash))
                return false;


            var xmlpath = ConstructXmlDescriptorFilePath(item, filmFolder, movieHash);


            if (DescriptorAlreadyExists(item, xmlpath))
                return true;


            var doc = ConstructMovieXmlDescriptorFromSectionItem(item, itemTitle, imdbid, movieHash);


            return SaveXmlDocument(item, filmFolder, doc, xmlpath);


        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:28,代码来源:MovieDescriptorWriter.cs

示例6: ConstructExtractedSubtitleFilename

        internal static string ConstructExtractedSubtitleFilename(IMLItem item, string zipfilePath, out string subtitleExtension)
        {
            string subtitleFilename =
                RecognizeCorrectSubtitle(zipfilePath);

            if (String.IsNullOrEmpty(subtitleFilename))
            {

                MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
                            "Could not extract subtitle. The archive is corrupt.");

                Debugger.LogMessageToFile("Could not extract subtitle for "
                            + item.Name + ". The archive is corrupt.");

                Thread.Sleep(Settings.SleepValue);

                subtitleExtension = null;

                return subtitleFilename;

            }

            subtitleExtension = subtitleFilename.Remove(0, subtitleFilename.Length - 4);

            return subtitleFilename;
        }
开发者ID:stavrossk,项目名称:Automated-Video-Subtitle-Importer-for-MeediOS,代码行数:26,代码来源:VideoSubtitleDownloaderHelpers.cs

示例7:

        private static void DeleteMediaImagesAndLibraryItem
            (IMLSection section, IMLItem item)
        {


            Debugger.LogMessageToFile(String.Format("The non-existent item {0}will be deleted from section.",
                item.Name));


            Helpers.UpdateProgress
                ("Performing Diagnostic Operations",
                String.Format("The non-existent item " +
                              "{0} will be deleted from section.",
                                item.Name), item);

            Thread.Sleep(100);


            string imageFile = item.ImageFile;
            string fanart = (string) item.Tags["fanart"];


            DeleteCoverAndFanartImages
                (fanart, imageFile);


            section.DeleteItem(item);
        
        
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:30,代码来源:MissingItemRemover.cs

示例8: UploadVideoHash

        public static bool UploadVideoHash(IMLItem Item, string location, string imdbid, ConnectionResult connectionresult, bool FileServerIsOnline, bool IsUNC)
        {

            if (String.IsNullOrEmpty(imdbid))
            {
                Debugger.LogMessageToFile("[OSdb movie hash uploader] This video's IMDb ID is not available. Uploading of it's file hash cannot be performed.");
                return false;
            }

            if (!FileServerIsOnline && IsUNC)
            {
                Debugger.LogMessageToFile("[OSdb movie hash uploader] Your file server is offline. ");
                return false;
            }

            if (!File.Exists(location))
                return false;

            string moviehash = Helpers.GetTagValueFromItem(Item, "VideoHash");

            if (String.IsNullOrEmpty(moviehash))
                return false;

           
            #region get file info
            Debugger.LogMessageToFile("[OSdb movie hash uploader] Extracting file information for movie hash uploading...");
            FileInfo file = new FileInfo(location);
            long filesize = file.Length;
            string imdbidNumOnly = imdbid.Remove(0, 2);      
            #endregion

            return PerformUploading(Item, moviehash, connectionresult, filesize, imdbidNumOnly);
        
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:34,代码来源:OSdbMovieHashUploader.cs

示例9: ReturnCases

        private static bool ReturnCases(bool deleteMissingLibraryEntries, 
            bool isUNC, bool fileServerIsOnline, string location,
                                        IMLItem item)
        {


            if (!deleteMissingLibraryEntries)
                return false;


            //if (!location.StartsWith(Settings.DvdDrive) || String.IsNullOrEmpty(Settings.DvdDrive))
            //{

            if (isUNC && !fileServerIsOnline)
                return false;


            Debugger.LogMessageToFile(String.Format("Validating item {0}...", item.Name));
            Helpers.UpdateProgress("Performing Diagnostic Operations", String.Format("Validating item {0}...", item.Name), item);


            return !File.Exists(location);
        
        
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:25,代码来源:MissingItemRemover.cs

示例10: FileIsInUse

        public static void FileIsInUse(string location, 
            bool fileServerIsOnline,
            IMLItem item)
        {
            if (!fileServerIsOnline)
                return;

            try
            {
                Debugger.LogMessageToFile("Checking if file is in use...");
                var filestream = File.OpenRead(location);
                filestream.Close();
                Settings.FileInUse = false;
            }
            catch (Exception)
            {
                Debugger.LogMessageToFile(String.Format
                    ("The file {0} is in use by another program.", location));

                UpdateProgress
                    ("Performing diagnostics",
                    String.Format
                    ("This item's media file {0} " +
                     "is in use by another program." +
                     " MediFairy can not perform" +
                     " this operation.", location));

                Thread.Sleep(1500);

                Settings.FileInUse = true;

            }
        }
开发者ID:stavrossk,项目名称:Easy_Film_Importer_for_MeediOS,代码行数:33,代码来源:Helpers.cs

示例11: DeleteSubtitleZipFile

        internal static bool CheckForExistingSubtitleSetHasSubtitleFlag
            (string itemName, IMLItem item, string parentPath,
             string subfilePathSrt, string subfilePathSub)
        {


            MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
                                                      "Determining if subtitle exists for " + item.Name);


            if (File.Exists(subfilePathSrt) || File.Exists(subfilePathSub))
            {
                item.Tags["HasSubtitle"] = "True";
                item.SaveTags();

                DeleteSubtitleZipFile(itemName, parentPath);

                return false; 
            
            }



            return true;
       
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:26,代码来源:VideoSubtitleDownloaderHelpers.cs

示例12: ParseChildNodes

        private static bool ParseChildNodes(IMLItem item, string title, string videoHash, IEnumerable nodelist)
        {

            foreach (XmlNode childnode in
                from XmlNode node in nodelist
                where node.HasChildNodes
                from XmlNode childnode
                    in node.ChildNodes
                select childnode)
            {

                if (!ReadVideoHashAndTitle
                    (item, videoHash,
                    title, childnode))
                    return false;


                ReadAdditonalDetails
                    (item, childnode);

                item.SaveTags();
            }

            return true;
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:25,代码来源:MovieDescriptorReader.cs

示例13: PerformUploading

        private static bool PerformUploading(IMLItem Item, string moviehash, ConnectionResult connectionresult, long filesize, string imdbidNumOnly)
        {
            try
            {
                MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress, "Updating video definitions database...");
                InsertVideoHash(Item, connectionresult.OsDbLoginResult.token, moviehash, filesize,
                                             imdbidNumOnly);
                return true;
            }
            catch
            {
                MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
                                               "Osdb database did not respond. Retrying...");
                Thread.Sleep(3000);
                try
                {
                    InsertVideoHash(Item, connectionresult.OsDbLoginResult.token, moviehash, filesize,
                                                 imdbidNumOnly);
                    return true;
                }
                catch
                {
                    Debugger.LogMessageToFile("Unable to communicate with OSdb. Video hash was not uploaded.");
                    MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress,
                                                   "Unable to communicate with OSdb. Video hash was not uploaded.");
                    return false;
                }

            }


        }//endof method
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:32,代码来源:OSdbMovieHashUploader.cs

示例14: IdentifyMovieByVideoFingerprint

        internal static string IdentifyMovieByVideoFingerprint(IMLItem item, ConnectionResult connectionresult, bool FileServerIsOnline, bool IsUNC, string location, string parent )
        {

            #region function variables

            string moviehash = Helpers.GetTagValueFromItem(item,"VideoHash");
            string imdbid = Helpers.GetTagValueFromItem(item,"ImdbID");
            #endregion


            if (!String.IsNullOrEmpty(imdbid))
                return imdbid;

            #region Compute Hash
            if (String.IsNullOrEmpty(moviehash))
            {
                //if ( Importer.EnableHashing)
                //{
                if (!IsUNC || FileServerIsOnline)
                {
                    if (File.Exists(location))
                    {
                        Debugger.LogMessageToFile("Computing video fingerprint for " + item.Name + "...");
                        MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress, "Computing video fingerprint for " + item.Name + "...");
                        Thread.Sleep(200);
                        moviehash = Hasher.ComputeHash(location, item);
                        item.Tags["VideoHash"] = moviehash;
                        item.SaveTags();
                    }
                    else
                    {
                        MainImportingEngine.ThisProgress.Progress(MainImportingEngine.CurrentProgress, "The video file in location field was not found. MediaFairy cannot identify this film.");
                        Thread.Sleep(Settings.SleepValue);
                    }
                }
                //}
            }
            else moviehash = Helpers.GetTagValueFromItem(item,"VideoHash");

            item.SaveTags();
            #endregion


            MovieDescriptorReader.ReadMovieDescriptor(item, moviehash, parent, item.Name );


            if (Settings.PrimaryVideoFingerprintMatchingSource == "OSDb")
            {
                OSDbVideoFingeprintIdentifier.IdentifyMovieByHashOSDb(item, connectionresult);
                imdbid = TMDbVideoFingerprintIdentifier.IdentifyMovieByHashTMDb(item, connectionresult);
            }
            else
            {
                TMDbVideoFingerprintIdentifier.IdentifyMovieByHashTMDb(item, connectionresult);
                imdbid = OSDbVideoFingeprintIdentifier.IdentifyMovieByHashOSDb(item, connectionresult);
            }

            return imdbid;
        }
开发者ID:stavrossk,项目名称:MeediFier_for_MeediOS,代码行数:59,代码来源:VideoFingerprintIdentifier.cs

示例15: RetrieveFileHash

        internal static void RetrieveFileHash(IMLItem item, string location)
        {
            if (CheckForExistingHash(item))
                return;

            CalculateAndSaveHashToLibrary
                (item, location);
        }
开发者ID:stavrossk,项目名称:Automated-Video-Subtitle-Importer-for-MeediOS,代码行数:8,代码来源:VideoHashConstructor.cs


注:本文中的IMLItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。