Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Guid for BaseItemDto parent ids #7239

Merged
merged 1 commit into from
Jan 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 4 additions & 9 deletions Emby.Server.Implementations/Dto/DtoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -458,11 +458,6 @@ private static void SetPhotoProperties(BaseItemDto dto, Photo item)
}
}

private string GetDtoId(BaseItem item)
{
return item.Id.ToString("N", CultureInfo.InvariantCulture);
}

private void SetMusicVideoProperties(BaseItemDto dto, MusicVideo item)
{
if (!string.IsNullOrEmpty(item.Album))
Expand Down Expand Up @@ -1324,7 +1319,7 @@ private void AddInheritedImages(BaseItemDto dto, BaseItem item, DtoOptions optio

if (image != null)
{
dto.ParentLogoItemId = GetDtoId(parent);
dto.ParentLogoItemId = parent.Id;
dto.ParentLogoImageTag = GetTagAndFillBlurhash(dto, parent, image);
}
}
Expand All @@ -1335,7 +1330,7 @@ private void AddInheritedImages(BaseItemDto dto, BaseItem item, DtoOptions optio

if (image != null)
{
dto.ParentArtItemId = GetDtoId(parent);
dto.ParentArtItemId = parent.Id;
dto.ParentArtImageTag = GetTagAndFillBlurhash(dto, parent, image);
}
}
Expand All @@ -1346,7 +1341,7 @@ private void AddInheritedImages(BaseItemDto dto, BaseItem item, DtoOptions optio

if (image != null)
{
dto.ParentThumbItemId = GetDtoId(parent);
dto.ParentThumbItemId = parent.Id;
dto.ParentThumbImageTag = GetTagAndFillBlurhash(dto, parent, image);
}
}
Expand All @@ -1357,7 +1352,7 @@ private void AddInheritedImages(BaseItemDto dto, BaseItem item, DtoOptions optio

if (images.Count > 0)
{
dto.ParentBackdropItemId = GetDtoId(parent);
dto.ParentBackdropItemId = parent.Id;
dto.ParentBackdropImageTags = GetTagsAndFillBlurhashes(dto, parent, ImageType.Backdrop, images);
}
}
Expand Down
6 changes: 3 additions & 3 deletions Emby.Server.Implementations/LiveTv/LiveTvDtoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private void FillImages(BaseItemDto dto, string seriesName, string programSeries
try
{
dto.ParentThumbImageTag = _imageProcessor.GetImageCacheTag(librarySeries, image);
dto.ParentThumbItemId = librarySeries.Id.ToString("N", CultureInfo.InvariantCulture);
dto.ParentThumbItemId = librarySeries.Id;
}
catch (Exception ex)
{
Expand All @@ -193,7 +193,7 @@ private void FillImages(BaseItemDto dto, string seriesName, string programSeries
{
_imageProcessor.GetImageCacheTag(librarySeries, image)
};
dto.ParentBackdropItemId = librarySeries.Id.ToString("N", CultureInfo.InvariantCulture);
dto.ParentBackdropItemId = librarySeries.Id;
}
catch (Exception ex)
{
Expand Down Expand Up @@ -240,7 +240,7 @@ private void FillImages(BaseItemDto dto, string seriesName, string programSeries
_imageProcessor.GetImageCacheTag(program, image)
};

dto.ParentBackdropItemId = program.Id.ToString("N", CultureInfo.InvariantCulture);
dto.ParentBackdropItemId = program.Id;
}
catch (Exception ex)
{
Expand Down
8 changes: 4 additions & 4 deletions MediaBrowser.Model/Dto/BaseItemDto.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ public class BaseItemDto : IHasProviderIds, IItemDto, IHasServerId
/// Gets or sets wether the item has a logo, this will hold the Id of the Parent that has one.
/// </summary>
/// <value>The parent logo item id.</value>
public string ParentLogoItemId { get; set; }
public Guid? ParentLogoItemId { get; set; }

/// <summary>
/// Gets or sets wether the item has any backdrops, this will hold the Id of the Parent that has one.
/// </summary>
/// <value>The parent backdrop item id.</value>
public string ParentBackdropItemId { get; set; }
public Guid? ParentBackdropItemId { get; set; }

/// <summary>
/// Gets or sets the parent backdrop image tags.
Expand Down Expand Up @@ -509,7 +509,7 @@ public class BaseItemDto : IHasProviderIds, IItemDto, IHasServerId
/// Gets or sets wether the item has fan art, this will hold the Id of the Parent that has one.
/// </summary>
/// <value>The parent art item id.</value>
public string ParentArtItemId { get; set; }
public Guid? ParentArtItemId { get; set; }

/// <summary>
/// Gets or sets the parent art image tag.
Expand Down Expand Up @@ -540,7 +540,7 @@ public class BaseItemDto : IHasProviderIds, IItemDto, IHasServerId
/// Gets or sets the parent thumb item id.
/// </summary>
/// <value>The parent thumb item id.</value>
public string ParentThumbItemId { get; set; }
public Guid? ParentThumbItemId { get; set; }

/// <summary>
/// Gets or sets the parent thumb image tag.
Expand Down