Skip to content

Commit

Permalink
Remove support for games as a media type
Browse files Browse the repository at this point in the history
  • Loading branch information
cvium authored and Bond-009 committed Jan 31, 2019
1 parent b5e8cce commit 8985fb8
Show file tree
Hide file tree
Showing 102 changed files with 9 additions and 1,705 deletions.
4 changes: 2 additions & 2 deletions Emby.Dlna/ContentDirectory/ControlHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ private QueryResult<BaseItem> GetChildrenSorted(BaseItem item, User user, Search
User = user,
Recursive = true,
IsMissing = false,
ExcludeItemTypes = new[] { typeof(Game).Name, typeof(Book).Name },
ExcludeItemTypes = new[] { typeof(Book).Name },
IsFolder = isFolder,
MediaTypes = mediaTypes.ToArray(),
DtoOptions = GetDtoOptions()
Expand Down Expand Up @@ -523,7 +523,7 @@ private QueryResult<ServerItem> GetUserItems(BaseItem item, StubType? stubType,
Limit = limit,
StartIndex = startIndex,
IsVirtualItem = false,
ExcludeItemTypes = new[] { typeof(Game).Name, typeof(Book).Name },
ExcludeItemTypes = new[] { typeof(Book).Name },
IsPlaceHolder = false,
DtoOptions = GetDtoOptions()
};
Expand Down
2 changes: 1 addition & 1 deletion Emby.Dlna/Didl/DidlBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ private void WriteObjectClass(XmlWriter writer, BaseItem item, StubType? stubTyp
{
writer.WriteString(_profile.RequiresPlainFolders ? "object.container.storageFolder" : "object.container.genre.musicGenre");
}
else if (item is Genre || item is GameGenre)
else if (item is Genre)
{
writer.WriteString(_profile.RequiresPlainFolders ? "object.container.storageFolder" : "object.container.genre");
}
Expand Down
10 changes: 0 additions & 10 deletions Emby.Notifications/CoreNotificationTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,6 @@ public IEnumerable<NotificationTypeInfo> GetNotificationTypes()
Type = NotificationType.AudioPlayback.ToString()
},

new NotificationTypeInfo
{
Type = NotificationType.GamePlayback.ToString()
},

new NotificationTypeInfo
{
Type = NotificationType.VideoPlayback.ToString()
Expand All @@ -88,11 +83,6 @@ public IEnumerable<NotificationTypeInfo> GetNotificationTypes()
Type = NotificationType.AudioPlaybackStopped.ToString()
},

new NotificationTypeInfo
{
Type = NotificationType.GamePlaybackStopped.ToString()
},

new NotificationTypeInfo
{
Type = NotificationType.VideoPlaybackStopped.ToString()
Expand Down
8 changes: 0 additions & 8 deletions Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,6 @@ private static string GetPlaybackNotificationType(string mediaType)
{
return NotificationType.AudioPlayback.ToString();
}
if (string.Equals(mediaType, MediaType.Game, StringComparison.OrdinalIgnoreCase))
{
return NotificationType.GamePlayback.ToString();
}
if (string.Equals(mediaType, MediaType.Video, StringComparison.OrdinalIgnoreCase))
{
return NotificationType.VideoPlayback.ToString();
Expand All @@ -225,10 +221,6 @@ private static string GetPlaybackStoppedNotificationType(string mediaType)
{
return NotificationType.AudioPlaybackStopped.ToString();
}
if (string.Equals(mediaType, MediaType.Game, StringComparison.OrdinalIgnoreCase))
{
return NotificationType.GamePlaybackStopped.ToString();
}
if (string.Equals(mediaType, MediaType.Video, StringComparison.OrdinalIgnoreCase))
{
return NotificationType.VideoPlaybackStopped.ToString();
Expand Down
1 change: 0 additions & 1 deletion Emby.Server.Implementations/ApplicationHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,6 @@ private IEnumerable<string> FilterAssembliesToLoad(IEnumerable<string> paths)

var minRequiredVersions = new Dictionary<string, Version>(StringComparer.OrdinalIgnoreCase)
{
{ "GameBrowser.dll", new Version(3, 1) },
{ "moviethemesongs.dll", new Version(1, 6) },
{ "themesongs.dll", new Version(1, 2) }
};
Expand Down
27 changes: 1 addition & 26 deletions Emby.Server.Implementations/Data/SqliteItemRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1239,10 +1239,6 @@ private bool TypeRequiresDeserialization(Type type)
{
return false;
}
else if (type == typeof(GameGenre))
{
return false;
}
else if (type == typeof(Genre))
{
return false;
Expand Down Expand Up @@ -4789,10 +4785,6 @@ private List<string> GetItemByNameTypesInQuery(InternalItemsQuery query)
{
list.Add(typeof(MusicGenre).Name);
}
if (IsTypeInQuery(typeof(GameGenre).Name, query))
{
list.Add(typeof(GameGenre).Name);
}
if (IsTypeInQuery(typeof(MusicArtist).Name, query))
{
list.Add(typeof(MusicArtist).Name);
Expand Down Expand Up @@ -4891,9 +4883,6 @@ private bool EnableGroupByPresentationUniqueKey(InternalItemsQuery query)
typeof(Book),
typeof(CollectionFolder),
typeof(Folder),
typeof(Game),
typeof(GameGenre),
typeof(GameSystem),
typeof(Genre),
typeof(Person),
typeof(Photo),
Expand Down Expand Up @@ -5251,11 +5240,6 @@ public QueryResult<Tuple<BaseItem, ItemCounts>> GetGenres(InternalItemsQuery que
return GetItemValues(query, new[] { 2 }, typeof(Genre).FullName);
}

public QueryResult<Tuple<BaseItem, ItemCounts>> GetGameGenres(InternalItemsQuery query)
{
return GetItemValues(query, new[] { 2 }, typeof(GameGenre).FullName);
}

public QueryResult<Tuple<BaseItem, ItemCounts>> GetMusicGenres(InternalItemsQuery query)
{
return GetItemValues(query, new[] { 2 }, typeof(MusicGenre).FullName);
Expand All @@ -5276,14 +5260,9 @@ public List<string> GetMusicGenreNames()
return GetItemValueNames(new[] { 2 }, new List<string> { "Audio", "MusicVideo", "MusicAlbum", "MusicArtist" }, new List<string>());
}

public List<string> GetGameGenreNames()
{
return GetItemValueNames(new[] { 2 }, new List<string> { "Game" }, new List<string>());
}

public List<string> GetGenreNames()
{
return GetItemValueNames(new[] { 2 }, new List<string>(), new List<string> { "Audio", "MusicVideo", "MusicAlbum", "MusicArtist", "Game", "GameSystem" });
return GetItemValueNames(new[] { 2 }, new List<string>(), new List<string> { "Audio", "MusicVideo", "MusicAlbum", "MusicArtist" });
}

private List<string> GetItemValueNames(int[] itemValueTypes, List<string> withItemTypes, List<string> excludeItemTypes)
Expand Down Expand Up @@ -5652,10 +5631,6 @@ private ItemCounts GetItemCounts(IReadOnlyList<IResultSetValue> reader, int coun
{
counts.SongCount = value;
}
else if (string.Equals(typeName, typeof(Game).FullName, StringComparison.OrdinalIgnoreCase))
{
counts.GameCount = value;
}
else if (string.Equals(typeName, typeof(Trailer).FullName, StringComparison.OrdinalIgnoreCase))
{
counts.TrailerCount = value;
Expand Down
35 changes: 0 additions & 35 deletions Emby.Server.Implementations/Dto/DtoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -374,18 +374,13 @@ private static void SetItemByNameInfo(BaseItem item, BaseItemDto dto, IList<Base
dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo);
dto.SongCount = taggedItems.Count(i => i is Audio);
}
else if (item is GameGenre)
{
dto.GameCount = taggedItems.Count(i => i is Game);
}
else
{
// This populates them all and covers Genre, Person, Studio, Year

dto.ArtistCount = taggedItems.Count(i => i is MusicArtist);
dto.AlbumCount = taggedItems.Count(i => i is MusicAlbum);
dto.EpisodeCount = taggedItems.Count(i => i is Episode);
dto.GameCount = taggedItems.Count(i => i is Game);
dto.MovieCount = taggedItems.Count(i => i is Movie);
dto.TrailerCount = taggedItems.Count(i => i is Trailer);
dto.MusicVideoCount = taggedItems.Count(i => i is MusicVideo);
Expand Down Expand Up @@ -532,17 +527,6 @@ private void SetMusicVideoProperties(BaseItemDto dto, MusicVideo item)
dto.Album = item.Album;
}

private static void SetGameProperties(BaseItemDto dto, Game item)
{
dto.GameSystem = item.GameSystem;
dto.MultiPartGameFiles = item.MultiPartGameFiles;
}

private static void SetGameSystemProperties(BaseItemDto dto, GameSystem item)
{
dto.GameSystem = item.GameSystemName;
}

private string[] GetImageTags(BaseItem item, List<ItemImageInfo> images)
{
return images
Expand Down Expand Up @@ -698,11 +682,6 @@ private Guid GetGenreId(string name, BaseItem owner)
return _libraryManager.GetMusicGenreId(name);
}

if (owner is Game || owner is GameSystem)
{
return _libraryManager.GetGameGenreId(name);
}

return _libraryManager.GetGenreId(name);
}

Expand Down Expand Up @@ -1206,20 +1185,6 @@ private void AttachBasicFields(BaseItemDto dto, BaseItem item, BaseItem owner, D
}
}

var game = item as Game;

if (game != null)
{
SetGameProperties(dto, game);
}

var gameSystem = item as GameSystem;

if (gameSystem != null)
{
SetGameSystemProperties(dto, gameSystem);
}

var musicVideo = item as MusicVideo;
if (musicVideo != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ protected virtual string CreateImage(BaseItem item,
{
return CreateSquareCollage(item, itemsWithImages, outputPath);
}
if (item is Playlist || item is MusicGenre || item is Genre || item is GameGenre || item is PhotoAlbum)
if (item is Playlist || item is MusicGenre || item is Genre || item is PhotoAlbum)
{
return CreateSquareCollage(item, itemsWithImages, outputPath);
}
Expand Down
26 changes: 0 additions & 26 deletions Emby.Server.Implementations/Library/LibraryManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -869,11 +869,6 @@ public Guid GetMusicGenreId(string name)
return GetItemByNameId<MusicGenre>(MusicGenre.GetPath, name);
}

public Guid GetGameGenreId(string name)
{
return GetItemByNameId<GameGenre>(GameGenre.GetPath, name);
}

/// <summary>
/// Gets a Genre
/// </summary>
Expand All @@ -894,16 +889,6 @@ public MusicGenre GetMusicGenre(string name)
return CreateItemByName<MusicGenre>(MusicGenre.GetPath, name, new DtoOptions(true));
}

/// <summary>
/// Gets the game genre.
/// </summary>
/// <param name="name">The name.</param>
/// <returns>Task{GameGenre}.</returns>
public GameGenre GetGameGenre(string name)
{
return CreateItemByName<GameGenre>(GameGenre.GetPath, name, new DtoOptions(true));
}

/// <summary>
/// Gets a Year
/// </summary>
Expand Down Expand Up @@ -1370,17 +1355,6 @@ public QueryResult<Tuple<BaseItem, ItemCounts>> GetGenres(InternalItemsQuery que
return ItemRepository.GetGenres(query);
}

public QueryResult<Tuple<BaseItem, ItemCounts>> GetGameGenres(InternalItemsQuery query)
{
if (query.User != null)
{
AddUserToQuery(query, query.User);
}

SetTopParentOrAncestorIds(query);
return ItemRepository.GetGameGenres(query);
}

public QueryResult<Tuple<BaseItem, ItemCounts>> GetMusicGenres(InternalItemsQuery query)
{
if (query.User != null)
Expand Down
2 changes: 0 additions & 2 deletions Emby.Server.Implementations/Library/SearchEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ private List<SearchHintInfo> GetSearchHints(SearchQuery query, User user)
if (!query.IncludeMedia)
{
AddIfMissing(includeItemTypes, typeof(Genre).Name);
AddIfMissing(includeItemTypes, typeof(GameGenre).Name);
AddIfMissing(includeItemTypes, typeof(MusicGenre).Name);
}
}
else
{
AddIfMissing(excludeItemTypes, typeof(Genre).Name);
AddIfMissing(excludeItemTypes, typeof(GameGenre).Name);
AddIfMissing(excludeItemTypes, typeof(MusicGenre).Name);
}

Expand Down
4 changes: 0 additions & 4 deletions Emby.Server.Implementations/Library/UserViewManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,6 @@ private List<BaseItem> GetItemsForLatestItems(User user, LatestItemsQuery reques
mediaTypes.Add(MediaType.Book);
mediaTypes.Add(MediaType.Audio);
break;
case CollectionType.Games:
mediaTypes.Add(MediaType.Game);
break;
case CollectionType.Music:
mediaTypes.Add(MediaType.Audio);
break;
Expand All @@ -336,7 +333,6 @@ private List<BaseItem> GetItemsForLatestItems(User user, LatestItemsQuery reques
typeof(Person).Name,
typeof(Studio).Name,
typeof(Year).Name,
typeof(GameGenre).Name,
typeof(MusicGenre).Name,
typeof(Genre).Name

Expand Down

This file was deleted.

Loading

0 comments on commit 8985fb8

Please sign in to comment.