diff options
| author | Claus Vium <cvium@users.noreply.github.com> | 2019-01-24 18:48:37 +0100 |
|---|---|---|
| committer | Bond-009 <bond.009@outlook.com> | 2019-01-24 18:48:37 +0100 |
| commit | b2ffad9ce946544d87e285fd200c089b47bfb323 (patch) | |
| tree | 5deeea1918833bdc33bb6c706306a03e8f5c8378 | |
| parent | bd550ef99649921af46c33c44210b2bd48d39ea0 (diff) | |
Set Parent to current query Item if ParentId is empty (#680)
**Changes**
Fixed a faulty change in logic that occurred during the Christmas GPL nightmare.
I stepped through Emby 3.5.2 and stumbled over a difference in the query between Jellyfin and Emby, where in Emby, query.ParentId was set to the item itself. So I did a little digging in the old GPLv2 source and found this https://github.com/MediaBrowser/Emby/blob/3.4.1.8/MediaBrowser.Controller/Entities/Folder.cs#L720
**Issues**
Fixes #673
| -rw-r--r-- | MediaBrowser.Controller/Entities/Folder.cs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index 2103e0045..dab96509c 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -644,12 +644,9 @@ namespace MediaBrowser.Controller.Entities return PostFilterAndSort(items, query, true); } - if (!(this is UserRootFolder) && !(this is AggregateFolder)) + if (!(this is UserRootFolder) && !(this is AggregateFolder) && query.ParentId == Guid.Empty) { - if (!query.ParentId.Equals(Guid.Empty)) - { - query.Parent = this; - } + query.Parent = this; } if (RequiresPostFiltering2(query)) |
