소스 검색

URL decode name in VLCNetworkServerBrowserItemVLCMedia

In order to determine its name, a VLCNetworkServerBrowserItemVLCMedia will first check if its media has been parsed and use the parsed title information if it has been. If it hasn't been parsed, it will fallback to the filename of the media and if that doesn't work, the whole path of the media. The filename and path of media are URL encoded (at least in the case where the media is located on an SMB share). This commit adds decoding of the URL encoded values when setting the name of a VLCNetworkServerBrowserItemVLCMedia.

Signed-off-by: Felix Paul Kühne <fkuehne@videolan.org>
Benjamin Adolphi 9 년 전
부모
커밋
31bb1d6932
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      SharedSources/ServerBrowsing/General/VLCNetworkServerBrowserVLCMedia.m

+ 2 - 2
SharedSources/ServerBrowsing/General/VLCNetworkServerBrowserVLCMedia.m

@@ -158,10 +158,10 @@
             title = [media metadataForKey:VLCMetaInformationTitle];
         }
         if (!title) {
-            title = media.url.lastPathComponent;
+            title = [media.url.lastPathComponent stringByRemovingPercentEncoding];
         }
         if (!title) {
-            title = media.url.absoluteString;
+            title = [media.url.absoluteString stringByRemovingPercentEncoding];
         }
         _name = title;
         _URL = media.url;