<commit_before>﻿using MediaBrowser.Model.ApiClient;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Theater.Interfaces.Presentation;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace MediaBrowser.Plugins.DefaultTheme.Pages.FolderBrowsing
{
    /// <summary>
    /// Interaction logic for Sidebar.xaml
    /// </summary>
    public partial class Sidebar : UserControl
    {
        private BaseItemDto _item;
        public BaseItemDto Item
        {
            get
            {
                return _item;
            }
            set
            {
                _item = value;

                if (value != null)
                {
                    OnItemChanged(value);
                }
            }
        }

        private readonly IApiClient _apiClient;
        private readonly IImageManager _imageManager;

        public Sidebar(IApiClient apiClient, IImageManager imageManager)
        {
            _apiClient = apiClient;
            _imageManager = imageManager;
            InitializeComponent();
        }

        private async void OnItemChanged(BaseItemDto item)
        {
            UpdateLogo(item);

            if (item.HasLogo)
            {
                LogoImage.Source = await _imageManager.GetRemoteBitmapAsync(_apiClient.GetLogoImageUrl(item, new ImageOptions
                {
                }));

                LogoImage.Visibility = Visibility.Visible;
                TxtTitle.Visibility = Visibility.Collapsed;
            }
            else
            {
                LogoImage.Visibility = Visibility.Collapsed;
                TxtTitle.Text = item.Name;
                TxtTitle.Visibility = Visibility.Visible;
            }

            TxtGenres.Visibility = item.Genres.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
            TxtGenres.Text = string.Join(" / ", item.Genres.Take(3).ToArray());

            TxtOverview.Text = item.Overview;
        }

        private async void UpdateLogo(BaseItemDto item)
        {<commit_msg>don't display genres for seasons or episodes<commit_after>﻿using MediaBrowser.Model.ApiClient;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Theater.Interfaces.Presentation;
using System.Linq;
using System.Windows;
using System.Windows.Controls;

namespace MediaBrowser.Plugins.DefaultTheme.Pages.FolderBrowsing
{
    /// <summary>
    /// Interaction logic for Sidebar.xaml
    /// </summary>
    public partial class Sidebar : UserControl
    {
        private BaseItemDto _item;
        public BaseItemDto Item
        {
            get
            {
                return _item;
            }
            set
            {
                _item = value;

                if (value != null)
                {
                    OnItemChanged(value);
                }
            }
        }

        private readonly IApiClient _apiClient;
        private readonly IImageManager _imageManager;

        public Sidebar(IApiClient apiClient, IImageManager imageManager)
        {
            _apiClient = apiClient;
            _imageManager = imageManager;
            InitializeComponent();
        }

        private async void OnItemChanged(BaseItemDto item)
        {
            UpdateLogo(item);

            if (item.HasLogo)
            {
                LogoImage.Source = await _imageManager.GetRemoteBitmapAsync(_apiClient.GetLogoImageUrl(item, new ImageOptions
                {
                }));

                LogoImage.Visibility = Visibility.Visible;
                TxtTitle.Visibility = Visibility.Collapsed;
            }
            else
            {
                LogoImage.Visibility = Visibility.Collapsed;
                TxtTitle.Text = item.Name;
                TxtTitle.Visibility = Visibility.Visible;
            }

            TxtGenres.Visibility = item.Genres.Count > 0 && !item.IsType("episode") && !item.IsType("season") ? Visibility.Visible : Visibility.Collapsed;

            TxtGenres.Text = string.Join(" / ", item.Genres.Take(3).ToArray());

            TxtOverview.Text = item.Overview;
        }

        private async void UpdateLogo(BaseItemDto item)
        {
{'fraction_non_alphanumeric': 0.07925242488762715, 'fraction_numerical': 0.0009462976105985332, 'mean_word_length': 1.6359102244389028, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5452770', 'n_tokens_mistral': 1109, 'n_tokens_neox': 1068, 'n_words': 208}