< Summary - Jellyfin

Information
Class: Jellyfin.Api.Controllers.ItemUpdateController
Assembly: Jellyfin.Api
File(s): /srv/git/jellyfin/Jellyfin.Api/Controllers/ItemUpdateController.cs
Line coverage
37%
Covered lines: 103
Uncovered lines: 174
Coverable lines: 277
Total lines: 586
Line coverage: 37.1%
Branch coverage
44%
Covered branches: 71
Total branches: 158
Branch coverage: 44.9%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 5/11/2026 - 12:15:59 AM Line coverage: 0% (0/261) Branch coverage: 0% (0/142) Total lines: 5457/16/2026 - 12:13:45 AM Line coverage: 0% (0/263) Branch coverage: 0% (0/146) Total lines: 5507/18/2026 - 12:15:19 AM Line coverage: 0% (0/265) Branch coverage: 0% (0/146) Total lines: 5547/22/2026 - 12:16:22 AM Line coverage: 21.4% (58/270) Branch coverage: 23% (35/152) Total lines: 57110/29/2026 - 12:17:11 AM Line coverage: 37.1% (103/277) Branch coverage: 44.9% (71/158) Total lines: 586 5/11/2026 - 12:15:59 AM Line coverage: 0% (0/261) Branch coverage: 0% (0/142) Total lines: 5457/16/2026 - 12:13:45 AM Line coverage: 0% (0/263) Branch coverage: 0% (0/146) Total lines: 5507/18/2026 - 12:15:19 AM Line coverage: 0% (0/265) Branch coverage: 0% (0/146) Total lines: 5547/22/2026 - 12:16:22 AM Line coverage: 21.4% (58/270) Branch coverage: 23% (35/152) Total lines: 57110/29/2026 - 12:17:11 AM Line coverage: 37.1% (103/277) Branch coverage: 44.9% (71/158) Total lines: 586

Coverage delta

Coverage delta 23 -23

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
UpdateItem()0%342180%
GetMetadataEditorInfo(...)0%702260%
UpdateItemContentType(...)0%2040%
UpdateItem()66.66%2389073.68%
GetPropagatedRating(...)100%1010100%
GetSeriesStatus(...)50%2266.66%
NormalizeDateTime(...)100%210%
GetContentTypeOptions(...)0%7280%

File(s)

/srv/git/jellyfin/Jellyfin.Api/Controllers/ItemUpdateController.cs

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using System.ComponentModel.DataAnnotations;
 4using System.Linq;
 5using System.Threading;
 6using System.Threading.Tasks;
 7using Jellyfin.Api.Constants;
 8using Jellyfin.Api.Extensions;
 9using Jellyfin.Api.Helpers;
 10using Jellyfin.Data.Enums;
 11using MediaBrowser.Common.Api;
 12using MediaBrowser.Controller.Configuration;
 13using MediaBrowser.Controller.Entities;
 14using MediaBrowser.Controller.Entities.Audio;
 15using MediaBrowser.Controller.Entities.TV;
 16using MediaBrowser.Controller.Library;
 17using MediaBrowser.Controller.LiveTv;
 18using MediaBrowser.Controller.Providers;
 19using MediaBrowser.Model.Dto;
 20using MediaBrowser.Model.Entities;
 21using MediaBrowser.Model.Globalization;
 22using MediaBrowser.Model.IO;
 23using Microsoft.AspNetCore.Authorization;
 24using Microsoft.AspNetCore.Http;
 25using Microsoft.AspNetCore.Mvc;
 26
 27namespace Jellyfin.Api.Controllers;
 28
 29/// <summary>
 30/// Item update controller.
 31/// </summary>
 32[Route("")]
 33[Authorize(Policy = Policies.RequiresElevation)]
 34public class ItemUpdateController : BaseJellyfinApiController
 35{
 36    private readonly ILibraryManager _libraryManager;
 37    private readonly IProviderManager _providerManager;
 38    private readonly ILocalizationManager _localizationManager;
 39    private readonly IFileSystem _fileSystem;
 40    private readonly IServerConfigurationManager _serverConfigurationManager;
 41
 42    /// <summary>
 43    /// Initializes a new instance of the <see cref="ItemUpdateController"/> class.
 44    /// </summary>
 45    /// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param>
 46    /// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param>
 47    /// <param name="providerManager">Instance of the <see cref="IProviderManager"/> interface.</param>
 48    /// <param name="localizationManager">Instance of the <see cref="ILocalizationManager"/> interface.</param>
 49    /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/> interface.</p
 650    public ItemUpdateController(
 651        IFileSystem fileSystem,
 652        ILibraryManager libraryManager,
 653        IProviderManager providerManager,
 654        ILocalizationManager localizationManager,
 655        IServerConfigurationManager serverConfigurationManager)
 56    {
 657        _libraryManager = libraryManager;
 658        _providerManager = providerManager;
 659        _localizationManager = localizationManager;
 660        _fileSystem = fileSystem;
 661        _serverConfigurationManager = serverConfigurationManager;
 662    }
 63
 64    /// <summary>
 65    /// Updates an item.
 66    /// </summary>
 67    /// <param name="itemId">The item id.</param>
 68    /// <param name="request">The new item properties.</param>
 69    /// <response code="204">Item updated.</response>
 70    /// <response code="404">Item not found.</response>
 71    /// <returns>An <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the item could not be
 72    [HttpPost("Items/{itemId}")]
 73    [ProducesResponseType(StatusCodes.Status204NoContent)]
 74    [ProducesResponseType(StatusCodes.Status404NotFound)]
 75    public async Task<ActionResult> UpdateItem([FromRoute, Required] Guid itemId, [FromBody, Required] BaseItemDto reque
 76    {
 077        var item = _libraryManager.GetItemById<BaseItem>(itemId, User.GetUserId());
 078        if (item is null)
 79        {
 080            return NotFound();
 81        }
 82
 083        var newLockData = request.LockData ?? false;
 084        var isLockedChanged = item.IsLocked != newLockData;
 85
 086        var series = item as Series;
 087        var displayOrderChanged = series is not null && !string.Equals(
 088            series.DisplayOrder ?? string.Empty,
 089            request.DisplayOrder ?? string.Empty,
 090            StringComparison.OrdinalIgnoreCase);
 91
 92        // Do this first so that metadata savers can pull the updates from the database.
 093        if (request.People is not null)
 94        {
 095            _libraryManager.UpdatePeople(
 096                item,
 097                request.People.Select(x => new PersonInfo
 098                {
 099                    Name = x.Name,
 0100                    Role = x.Role,
 0101                    Type = x.Type
 0102                }).ToList());
 103        }
 104
 0105        await UpdateItem(request, item).ConfigureAwait(false);
 106
 0107        item.OnMetadataChanged();
 108
 0109        await item.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
 110
 0111        if (isLockedChanged && item.IsFolder)
 112        {
 0113            var folder = (Folder)item;
 114
 0115            foreach (var child in folder.GetRecursiveChildren())
 116            {
 0117                child.IsLocked = newLockData;
 0118                await child.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(
 119            }
 120        }
 121
 0122        if (displayOrderChanged)
 123        {
 0124            _providerManager.QueueRefresh(
 0125                series!.Id,
 0126                new MetadataRefreshOptions(new DirectoryService(_fileSystem))
 0127                {
 0128                    MetadataRefreshMode = MetadataRefreshMode.FullRefresh,
 0129                    ImageRefreshMode = MetadataRefreshMode.FullRefresh,
 0130                    ReplaceAllMetadata = true
 0131                },
 0132                RefreshPriority.High);
 133        }
 134
 0135        return NoContent();
 0136    }
 137
 138    /// <summary>
 139    /// Gets metadata editor info for an item.
 140    /// </summary>
 141    /// <param name="itemId">The item id.</param>
 142    /// <response code="200">Item metadata editor returned.</response>
 143    /// <response code="404">Item not found.</response>
 144    /// <returns>An <see cref="OkResult"/> on success containing the metadata editor, or a <see cref="NotFoundResult"/> 
 145    [HttpGet("Items/{itemId}/MetadataEditor")]
 146    [ProducesResponseType(StatusCodes.Status200OK)]
 147    [ProducesResponseType(StatusCodes.Status404NotFound)]
 148    public ActionResult<MetadataEditorInfo> GetMetadataEditorInfo([FromRoute, Required] Guid itemId)
 149    {
 0150        var item = _libraryManager.GetItemById<BaseItem>(itemId, User.GetUserId());
 0151        if (item is null)
 152        {
 0153            return NotFound();
 154        }
 155
 0156        var info = new MetadataEditorInfo
 0157        {
 0158            ParentalRatingOptions = _localizationManager.GetParentalRatings().ToList(),
 0159            ExternalIdInfos = _providerManager.GetExternalIdInfos(item).ToArray(),
 0160            Countries = _localizationManager.GetCountries().ToArray(),
 0161            Cultures = _localizationManager.GetCultures()
 0162                .DistinctBy(c => c.DisplayName, StringComparer.OrdinalIgnoreCase)
 0163                .OrderBy(c => c.DisplayName)
 0164                .ToArray()
 0165        };
 166
 0167        if (!item.IsVirtualItem
 0168            && item is not ICollectionFolder
 0169            && item is not UserView
 0170            && item is not AggregateFolder
 0171            && item is not LiveTvChannel
 0172            && item is not IItemByName
 0173            && item.SourceType == SourceType.Library)
 174        {
 0175            var inheritedContentType = _libraryManager.GetInheritedContentType(item);
 0176            var configuredContentType = _libraryManager.GetConfiguredContentType(item);
 177
 0178            if (inheritedContentType is null || configuredContentType is not null)
 179            {
 0180                info.ContentTypeOptions = GetContentTypeOptions(true).ToArray();
 0181                info.ContentType = configuredContentType;
 182
 0183                if (inheritedContentType is null
 0184                    || inheritedContentType == CollectionType.tvshows
 0185                    || inheritedContentType == CollectionType.movies)
 186                {
 0187                    info.ContentTypeOptions = info.ContentTypeOptions
 0188                        .Where(i => string.IsNullOrWhiteSpace(i.Value)
 0189                                    || string.Equals(i.Value, "TvShows", StringComparison.OrdinalIgnoreCase)
 0190                                    || string.Equals(i.Value, "Movies", StringComparison.OrdinalIgnoreCase))
 0191                        .ToArray();
 192                }
 193            }
 194        }
 195
 0196        return info;
 197    }
 198
 199    /// <summary>
 200    /// Updates an item's content type.
 201    /// </summary>
 202    /// <param name="itemId">The item id.</param>
 203    /// <param name="contentType">The content type of the item.</param>
 204    /// <response code="204">Item content type updated.</response>
 205    /// <response code="404">Item not found.</response>
 206    /// <returns>An <see cref="NoContentResult"/> on success, or a <see cref="NotFoundResult"/> if the item could not be
 207    [HttpPost("Items/{itemId}/ContentType")]
 208    [ProducesResponseType(StatusCodes.Status204NoContent)]
 209    [ProducesResponseType(StatusCodes.Status404NotFound)]
 210    public ActionResult UpdateItemContentType([FromRoute, Required] Guid itemId, [FromQuery] string? contentType)
 211    {
 0212        var item = _libraryManager.GetItemById<BaseItem>(itemId, User.GetUserId());
 0213        if (item is null)
 214        {
 0215            return NotFound();
 216        }
 217
 0218        var path = item.ContainingFolderPath;
 219
 0220        var types = _serverConfigurationManager.Configuration.ContentTypes
 0221            .Where(i => !string.IsNullOrWhiteSpace(i.Name))
 0222            .Where(i => !string.Equals(i.Name, path, StringComparison.OrdinalIgnoreCase))
 0223            .ToList();
 224
 0225        if (!string.IsNullOrWhiteSpace(contentType))
 226        {
 0227            types.Add(new NameValuePair
 0228            {
 0229                Name = path,
 0230                Value = contentType
 0231            });
 232        }
 233
 0234        _serverConfigurationManager.Configuration.ContentTypes = types.ToArray();
 0235        _serverConfigurationManager.SaveConfiguration();
 0236        return NoContent();
 237    }
 238
 239    internal async Task UpdateItem(BaseItemDto request, BaseItem item)
 240    {
 6241        item.Name = request.Name;
 6242        item.ForcedSortName = request.ForcedSortName;
 243
 6244        item.OriginalTitle = string.IsNullOrWhiteSpace(request.OriginalTitle) ? null : request.OriginalTitle;
 6245        item.OriginalLanguage = string.IsNullOrWhiteSpace(request.OriginalLanguage) ? null : request.OriginalLanguage;
 246
 6247        item.CriticRating = request.CriticRating;
 248
 6249        item.CommunityRating = request.CommunityRating;
 6250        item.IndexNumber = request.IndexNumber;
 6251        item.ParentIndexNumber = request.ParentIndexNumber;
 6252        item.Overview = request.Overview;
 253
 6254        if (request.Genres is not null)
 255        {
 0256            item.Genres = request.Genres.Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
 257        }
 258
 6259        if (item is Episode episode)
 260        {
 0261            episode.AirsAfterSeasonNumber = request.AirsAfterSeasonNumber;
 0262            episode.AirsBeforeEpisodeNumber = request.AirsBeforeEpisodeNumber;
 0263            episode.AirsBeforeSeasonNumber = request.AirsBeforeSeasonNumber;
 264        }
 265
 6266        if (request.Height is not null && item is LiveTvChannel channel)
 267        {
 0268            channel.Height = request.Height.Value;
 269        }
 270
 6271        if (request.Taglines is not null)
 272        {
 0273            item.Tagline = request.Taglines.FirstOrDefault();
 274        }
 275
 6276        if (request.Studios is not null)
 277        {
 0278            item.Studios = Array.ConvertAll(request.Studios, x => x.Name).Distinct(StringComparer.OrdinalIgnoreCase).ToA
 279        }
 280
 6281        if (request.DateCreated.HasValue)
 282        {
 0283            item.DateCreated = NormalizeDateTime(request.DateCreated.Value);
 284        }
 285
 6286        if (request.SeriesName is not null && item is IHasSeries hasSeries)
 287        {
 0288            hasSeries.SeriesName = request.SeriesName;
 289        }
 290
 6291        item.EndDate = request.EndDate.HasValue ? NormalizeDateTime(request.EndDate.Value) : null;
 6292        item.PremiereDate = request.PremiereDate.HasValue ? NormalizeDateTime(request.PremiereDate.Value) : null;
 6293        item.ProductionYear = request.ProductionYear;
 294
 6295        var previousOfficialRating = item.OfficialRating;
 6296        var previousCustomRating = item.CustomRating;
 6297        request.OfficialRating = string.IsNullOrWhiteSpace(request.OfficialRating) ? null : request.OfficialRating;
 6298        item.OfficialRating = request.OfficialRating;
 6299        item.CustomRating = request.CustomRating;
 300
 6301        var currentTags = item.Tags;
 302        List<string> removedTags;
 303        List<string> addedTags;
 6304        if (request.Tags is not null)
 305        {
 2306            var newTags = request.Tags.Select(t => t.Trim()).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
 2307            removedTags = currentTags.Except(newTags).ToList();
 2308            addedTags = newTags.Except(currentTags).ToList();
 2309            item.Tags = newTags;
 310        }
 311        else
 312        {
 4313            removedTags = [];
 4314            addedTags = [];
 315        }
 316
 6317        if (item is Series rseries)
 318        {
 12319            foreach (var season in rseries.Children.OfType<Season>())
 320            {
 3321                season.SeriesName = rseries.Name;
 322
 3323                var previousSeasonOfficialRating = season.OfficialRating;
 3324                var previousSeasonCustomRating = season.CustomRating;
 3325                if (!season.LockedFields.Contains(MetadataField.OfficialRating))
 326                {
 3327                    season.OfficialRating = GetPropagatedRating(season.OfficialRating, previousOfficialRating, request.O
 328                }
 329
 3330                season.CustomRating = GetPropagatedRating(season.CustomRating, previousCustomRating, request.CustomRatin
 331
 3332                if (!season.LockedFields.Contains(MetadataField.Tags))
 333                {
 3334                    season.Tags = season.Tags.Concat(addedTags).Except(removedTags).Distinct(StringComparer.OrdinalIgnor
 335                }
 336
 3337                season.OnMetadataChanged();
 3338                await season.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait
 339
 26340                foreach (var ep in season.Children.OfType<Episode>())
 341                {
 10342                    ep.SeriesName = rseries.Name;
 343
 10344                    if (!ep.LockedFields.Contains(MetadataField.OfficialRating))
 345                    {
 9346                        ep.OfficialRating = GetPropagatedRating(ep.OfficialRating, previousSeasonOfficialRating, season.
 347                    }
 348
 10349                    ep.CustomRating = GetPropagatedRating(ep.CustomRating, previousSeasonCustomRating, season.CustomRati
 350
 10351                    if (!ep.LockedFields.Contains(MetadataField.Tags))
 352                    {
 10353                        ep.Tags = ep.Tags.Concat(addedTags).Except(removedTags).Distinct(StringComparer.OrdinalIgnoreCas
 354                    }
 355
 10356                    ep.OnMetadataChanged();
 10357                    await ep.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait
 358                }
 3359            }
 360        }
 3361        else if (item is Season season)
 362        {
 8363            foreach (var ep in season.Children.OfType<Episode>())
 364            {
 3365                ep.SeasonName = season.Name;
 366
 3367                if (!ep.LockedFields.Contains(MetadataField.OfficialRating))
 368                {
 3369                    ep.OfficialRating = GetPropagatedRating(ep.OfficialRating, previousOfficialRating, request.OfficialR
 370                }
 371
 3372                ep.CustomRating = GetPropagatedRating(ep.CustomRating, previousCustomRating, request.CustomRating);
 373
 3374                if (!ep.LockedFields.Contains(MetadataField.Tags))
 375                {
 3376                    ep.Tags = ep.Tags.Concat(addedTags).Except(removedTags).Distinct(StringComparer.OrdinalIgnoreCase).T
 377                }
 378
 3379                ep.OnMetadataChanged();
 3380                await ep.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(fal
 381            }
 382        }
 2383        else if (item is MusicAlbum album)
 384        {
 0385            foreach (BaseItem track in album.Children)
 386            {
 0387                if (!track.LockedFields.Contains(MetadataField.OfficialRating))
 388                {
 0389                    track.OfficialRating = GetPropagatedRating(track.OfficialRating, previousOfficialRating, request.Off
 390                }
 391
 0392                track.CustomRating = GetPropagatedRating(track.CustomRating, previousCustomRating, request.CustomRating)
 393
 0394                if (!track.LockedFields.Contains(MetadataField.Tags))
 395                {
 0396                    track.Tags = track.Tags.Concat(addedTags).Except(removedTags).Distinct(StringComparer.OrdinalIgnoreC
 397                }
 398
 0399                track.OnMetadataChanged();
 0400                await track.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(
 401            }
 402        }
 403
 6404        if (request.ProductionLocations is not null)
 405        {
 0406            item.ProductionLocations = request.ProductionLocations.Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
 407        }
 408
 6409        item.PreferredMetadataCountryCode = request.PreferredMetadataCountryCode;
 6410        item.PreferredMetadataLanguage = request.PreferredMetadataLanguage;
 411
 6412        if (item is IHasDisplayOrder hasDisplayOrder)
 413        {
 3414            hasDisplayOrder.DisplayOrder = request.DisplayOrder;
 415        }
 416
 6417        if (item is IHasAspectRatio hasAspectRatio)
 418        {
 2419            hasAspectRatio.AspectRatio = request.AspectRatio;
 420        }
 421
 6422        item.IsLocked = request.LockData ?? false;
 423
 6424        if (request.LockedFields is not null)
 425        {
 0426            item.LockedFields = request.LockedFields;
 427        }
 428
 429        // Only allow this for series. Runtimes for media comes from ffprobe.
 6430        if (item is Series)
 431        {
 3432            item.RunTimeTicks = request.RunTimeTicks;
 433        }
 434
 6435        if (request.ProviderIds is not null)
 436        {
 0437            item.SetProviderIds(request.ProviderIds);
 438        }
 439
 6440        if (item is Video video)
 441        {
 2442            video.Video3DFormat = request.Video3DFormat;
 443        }
 444
 6445        if (request.AlbumArtists is not null)
 446        {
 0447            if (item is IHasAlbumArtist hasAlbumArtists)
 448            {
 0449                hasAlbumArtists.AlbumArtists = Array.ConvertAll(request.AlbumArtists, i => i.Name.Trim()).Distinct(Strin
 450            }
 451        }
 452
 6453        if (request.ArtistItems is not null)
 454        {
 0455            if (item is IHasArtist hasArtists)
 456            {
 0457                hasArtists.Artists = Array.ConvertAll(request.ArtistItems, i => i.Name.Trim()).Distinct(StringComparer.O
 458            }
 459        }
 460
 461        switch (item)
 462        {
 463            case Audio song:
 0464                song.Album = request.Album;
 0465                break;
 466            case MusicVideo musicVideo:
 0467                musicVideo.Album = request.Album;
 0468                break;
 469            case Series series:
 470                {
 3471                    series.Status = GetSeriesStatus(request);
 472
 3473                    if (request.AirDays is not null)
 474                    {
 0475                        series.AirDays = request.AirDays;
 0476                        series.AirTime = request.AirTime;
 477                    }
 478
 479                    break;
 480                }
 481        }
 6482    }
 483
 484    /// <summary>
 485    /// Gets the rating a child should carry after its parent's rating changed from <paramref name="previousRating"/>
 486    /// to <paramref name="newRating"/>: a child with no rating, or the parent's previous one, follows the parent.
 487    /// A child with a rating of its own, or any child when the parent's rating did not change, keeps its rating.
 488    /// </summary>
 489    private static string? GetPropagatedRating(string? childRating, string? previousRating, string? newRating)
 490    {
 31491        if (string.Equals(previousRating ?? string.Empty, newRating ?? string.Empty, StringComparison.OrdinalIgnoreCase)
 492        {
 20493            return childRating;
 494        }
 495
 11496        return string.IsNullOrEmpty(childRating) || string.Equals(childRating, previousRating, StringComparison.OrdinalI
 11497            ? newRating
 11498            : childRating;
 499    }
 500
 501    private SeriesStatus? GetSeriesStatus(BaseItemDto item)
 502    {
 3503        if (string.IsNullOrEmpty(item.Status))
 504        {
 3505            return null;
 506        }
 507
 0508        return Enum.Parse<SeriesStatus>(item.Status, true);
 509    }
 510
 511    private DateTime NormalizeDateTime(DateTime val)
 512    {
 0513        return DateTime.SpecifyKind(val, DateTimeKind.Utc);
 514    }
 515
 516    private List<NameValuePair> GetContentTypeOptions(bool isForItem)
 517    {
 0518        var list = new List<NameValuePair>();
 519
 0520        if (isForItem)
 521        {
 0522            list.Add(new NameValuePair
 0523            {
 0524                Name = "Inherit",
 0525                Value = string.Empty
 0526            });
 527        }
 528
 0529        list.Add(new NameValuePair
 0530        {
 0531            Name = "Movies",
 0532            Value = "movies"
 0533        });
 0534        list.Add(new NameValuePair
 0535        {
 0536            Name = "Music",
 0537            Value = "music"
 0538        });
 0539        list.Add(new NameValuePair
 0540        {
 0541            Name = "Shows",
 0542            Value = "tvshows"
 0543        });
 544
 0545        if (!isForItem)
 546        {
 0547            list.Add(new NameValuePair
 0548            {
 0549                Name = "Books",
 0550                Value = "books"
 0551            });
 552        }
 553
 0554        list.Add(new NameValuePair
 0555        {
 0556            Name = "HomeVideos",
 0557            Value = "homevideos"
 0558        });
 0559        list.Add(new NameValuePair
 0560        {
 0561            Name = "MusicVideos",
 0562            Value = "musicvideos"
 0563        });
 0564        list.Add(new NameValuePair
 0565        {
 0566            Name = "Photos",
 0567            Value = "photos"
 0568        });
 569
 0570        if (!isForItem)
 571        {
 0572            list.Add(new NameValuePair
 0573            {
 0574                Name = "MixedContent",
 0575                Value = string.Empty
 0576            });
 577        }
 578
 0579        foreach (var val in list)
 580        {
 0581            val.Name = _localizationManager.GetLocalizedString(val.Name);
 582        }
 583
 0584        return list;
 585    }
 586}