Beispiel #1
0
        void setFanartPreviewBackground(FanartContainer fanart)
        {
            if (fanart == null)
            {
                ClearGUIProperty(GuiProperty.FanArt_SelectedFanartResolution);
                ClearGUIProperty(GuiProperty.FanArt_SelectedPreview);
                ClearGUIProperty(GuiProperty.FanArt_SelectedFanartIsDisabled);
                ClearGUIProperty(GuiProperty.FanArt_SelectedFanartIsDefault);
                ClearGUIProperty(GuiProperty.FanArt_Source);
                return;
            }

            if (fanart.ImageType == ImageEntityType.TvDB_FanArt)
            {
                VM_TvDB_ImageFanart fanartTvDb = fanart.FanartObject as VM_TvDB_ImageFanart;
                if (fanartTvDb != null)
                {
                    SetGUIProperty(GuiProperty.FanArt_SelectedFanartResolution, fanartTvDb.BannerType2);
                }
                else
                {
                    ClearGUIProperty(GuiProperty.FanArt_SelectedFanartResolution);
                }
            }
            else
            {
                ClearGUIProperty(GuiProperty.FanArt_SelectedFanartResolution);
            }

            SetGUIProperty(GuiProperty.FanArt_SelectedFanartIsDisabled, fanart.IsImageEnabled ? Translation.No : Translation.Yes);
            SetGUIProperty(GuiProperty.FanArt_SelectedFanartIsDefault, fanart.IsImageDefault ? Translation.Yes : Translation.No);
            SetGUIProperty(GuiProperty.FanArt_Source, fanart.FanartSource);

            string preview;

            if (File.Exists(fanart.FullImagePath))
            {
                // Ensure Fanart on Disk is valid as well
                ImageAllocator.LoadImageFastFromFile(fanart.FullImagePath);
                // Should be safe to assign fullsize fanart if available
                preview = ImageAllocator.GetOtherImage(fanart.FullImagePath, default(Size), false);
            }
            else
            {
                preview = m_Facade.SelectedListItem.IconImageBig;
            }

            SetGUIProperty(GuiProperty.FanArt_SelectedPreview, preview);
        }
Beispiel #2
0
        void setFanartPreviewBackground(FanartContainer fanart)
        {
            MainWindow.setGUIProperty("FanArt.SelectedFanartResolution", " ");
            MainWindow.setGUIProperty("FanArt.SelectedPreview", " ");
            MainWindow.setGUIProperty("FanArt.SelectedFanartIsDisabled", " ");
            MainWindow.setGUIProperty("FanArt.SelectedFanartIsDefault", " ");
            MainWindow.setGUIProperty("FanArt.Source", " ");

            if (fanart == null)
            {
                return;
            }

            if (fanart.ImageType == ImageEntityType.TvDB_FanArt)
            {
                TvDB_ImageFanartVM fanartTvDB = fanart.FanartObject as TvDB_ImageFanartVM;
                MainWindow.setGUIProperty("FanArt.SelectedFanartResolution", fanartTvDB.BannerType2);
            }

            MainWindow.setGUIProperty("FanArt.SelectedFanartIsDisabled", fanart.IsImageEnabled ? "No" : "Yes");
            MainWindow.setGUIProperty("FanArt.SelectedFanartIsDefault", fanart.IsImageDefault ? "Yes" : "No");
            MainWindow.setGUIProperty("FanArt.Source", fanart.FanartSource);

            string preview = string.Empty;

            if (File.Exists(fanart.FullImagePath))
            {
                // Ensure Fanart on Disk is valid as well
                ImageAllocator.LoadImageFastFromFile(fanart.FullImagePath);

                // Should be safe to assign fullsize fanart if available
                preview = ImageAllocator.GetOtherImage(fanart.FullImagePath, default(System.Drawing.Size), false);
            }
            else
            {
                preview = m_Facade.SelectedListItem.IconImageBig;
            }

            MainWindow.setGUIProperty("FanArt.SelectedPreview", preview);
        }