Ejemplo n.º 1
0
        /// <summary>
        /// Finishes any slow data for a gallery item.
        /// </summary>
        private void CompleteGalleryItem(VirtualList list, int index)
        {
            MovieItem item = (MovieItem)list[index];

            if (item.LoadedCover)
            {
                return;
            }

            //if (item.MenuCoverArt != MovieItem.NoCoverImage)
            //  return;

            Image image = null;

            // too many threads started, kills the system
            //Microsoft.MediaCenter.UI.Application.DeferredInvokeOnWorkerThread(delegate
            //{
            try
            {
                // OMLApplication.DebugLine("[MovieGallery] CompleteGalleryItem [index: {0}, name: {1}], load menu art", index, item.Name);
                string imageFile = OMLSettings.UseOriginalCoverArt
                    ? item.TitleObject.FrontCoverPath
                    : item.TitleObject.FrontCoverMenuPath;
                if (!string.IsNullOrEmpty(imageFile) && File.Exists(imageFile))
                {
                    image = GalleryItem.LoadImage(imageFile);
                }
            }
            catch (Exception e)
            {
                OMLApplication.DebugLine("[MovieGallery] Error: {0}\n    {1}", e.Message, e.StackTrace);
            }
            //}, delegate
            //{
            if (image != null)
            {
                // OMLApplication.DebugLine("[MovieGallery] CompleteGalleryItem [index: {0}, name: {1}], set menu art", index, item.Name);
                item.MenuCoverArt = image;
                item.LoadedCover  = true;
            }
            //}, null);
        }
Ejemplo n.º 2
0
        private void LoadDetails(MovieItem item)
        {
            // get the title from the db will full information
            Title title = OMLEngine.TitleCollectionManager.GetTitle(item.TitleObject.Id);

            // create a new movie item to use
            _movieDetails = new MovieItem(title, item.Gallery);

            //_localMedia = null;

            //DVDDiskInfo debug code
            //if (item.TitleObject.Disks.Count > 0)
            //{
            //    DVDDiskInfo info = item.TitleObject.Disks[0].DVDDiskInfo;
            //}

            if (!string.IsNullOrEmpty(item.TitleObject.FrontCoverPath))
            {
                if (File.Exists(item.TitleObject.FrontCoverPath))
                {
                    _fullCover = GalleryItem.LoadImage(item.TitleObject.FrontCoverPath);
                }
            }
            _diskChoice = new Choice();
            if (_movieDetails.Disks.Count > 0)
            {
                _diskChoice.Options = _movieDetails.FriendlyNamedDisks;
            }
            else
            {
                Disk[] temp = { new Disk() };
                temp[0].Name        = "Play Me";
                _diskChoice.Options = temp; // MCE barfs if Options is bound to empty List.
                OMLApplication.DebugLine("[MovieDetailsPage] Details Page.LoadMovies: no disks");
            }

            _watched.Chosen = (_movieDetails.TitleObject.WatchedCount != 0);

            SetupCastObjects();
        }