소스 검색

UPnP: give media objects a good title instead of the on-the-fly encoding pseudo-random hash some servers provide

This helps finding good subtitles
Felix Paul Kühne 9 년 전
부모
커밋
01b022b7c5
1개의 변경된 파일16개의 추가작업 그리고 2개의 파일을 삭제
  1. 16 2
      SharedSources/ServerBrowsing/UPnP/VLCNetworkServerBrowserUPnP.m

+ 16 - 2
SharedSources/ServerBrowsing/UPnP/VLCNetworkServerBrowserUPnP.m

@@ -292,7 +292,14 @@
 {
     if (!_URL)
         return nil;
-    return [VLCMedia mediaWithURL:_URL];
+
+    VLCMedia *media = [VLCMedia mediaWithURL:_URL];
+    NSString *title = self.name;
+    if (title.length) {
+        [media setMetadata:self.name forKey:VLCMetaInformationTitle];
+    }
+
+    return media;
 }
 
 @end
@@ -356,7 +363,14 @@
 {
     if (!_URL)
         return nil;
-    return [VLCMedia mediaWithURL:_URL];
+
+    VLCMedia *media = [VLCMedia mediaWithURL:_URL];
+    NSString *title = self.name;
+    if (title.length) {
+        [media setMetadata:self.name forKey:VLCMetaInformationTitle];
+    }
+
+    return media;
 }
 
 @end