Pārlūkot izejas kodu

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 gadi atpakaļ
vecāks
revīzija
01b022b7c5

+ 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