diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto/DtoService.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Dto/DtoService.cs | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index 88bf902db..520ffd417 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -846,16 +846,7 @@ namespace MediaBrowser.Server.Implementations.Dto if (fields.Contains(ItemFields.Path)) { - var locationType = item.LocationType; - - if (locationType != LocationType.Remote && locationType != LocationType.Virtual) - { - dto.Path = GetMappedPath(item.Path); - } - else - { - dto.Path = item.Path; - } + dto.Path = GetMappedPath(item); } dto.PremiereDate = item.PremiereDate; @@ -1315,14 +1306,12 @@ namespace MediaBrowser.Server.Implementations.Dto var locationType = item.LocationType; - if (locationType != LocationType.FileSystem && locationType != LocationType.Offline) - { - return path; - } - - foreach (var map in _config.Configuration.PathSubstitutions) + if (locationType == LocationType.FileSystem || locationType == LocationType.Offline) { - path = _fileSystem.SubstitutePath(path, map.From, map.To); + foreach (var map in _config.Configuration.PathSubstitutions) + { + path = _fileSystem.SubstitutePath(path, map.From, map.To); + } } return path; @@ -1418,16 +1407,6 @@ namespace MediaBrowser.Server.Implementations.Dto return string.Join("/", terms.ToArray()); } - private string GetMappedPath(string path) - { - foreach (var map in _config.Configuration.PathSubstitutions) - { - path = _fileSystem.SubstitutePath(path, map.From, map.To); - } - - return path; - } - private void SetProductionLocations(BaseItem item, BaseItemDto dto) { var hasProductionLocations = item as IHasProductionLocations; |
