mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-03 19:17:24 -05:00 
			
		
		
		
	Merge pull request #749 from 7illusions/master
DLNA Discovery and Profile fixes
This commit is contained in:
		
						commit
						1c3c12ebf6
					
				@ -70,55 +70,55 @@ namespace MediaBrowser.Dlna
 | 
			
		||||
        {
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(profileInfo.DeviceDescription))
 | 
			
		||||
            {
 | 
			
		||||
                if (!Regex.IsMatch(deviceInfo.DeviceDescription, profileInfo.DeviceDescription))
 | 
			
		||||
                if (deviceInfo.DeviceDescription == null || !Regex.IsMatch(deviceInfo.DeviceDescription, profileInfo.DeviceDescription))
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(profileInfo.FriendlyName))
 | 
			
		||||
            {
 | 
			
		||||
                if (!Regex.IsMatch(deviceInfo.FriendlyName, profileInfo.FriendlyName))
 | 
			
		||||
                if (deviceInfo.FriendlyName == null || !Regex.IsMatch(deviceInfo.FriendlyName, profileInfo.FriendlyName))
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(profileInfo.Manufacturer))
 | 
			
		||||
            {
 | 
			
		||||
                if (!Regex.IsMatch(deviceInfo.Manufacturer, profileInfo.Manufacturer))
 | 
			
		||||
                if (deviceInfo.Manufacturer == null || !Regex.IsMatch(deviceInfo.Manufacturer, profileInfo.Manufacturer))
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(profileInfo.ManufacturerUrl))
 | 
			
		||||
            {
 | 
			
		||||
                if (!Regex.IsMatch(deviceInfo.ManufacturerUrl, profileInfo.ManufacturerUrl))
 | 
			
		||||
                if (deviceInfo.ManufacturerUrl == null || !Regex.IsMatch(deviceInfo.ManufacturerUrl, profileInfo.ManufacturerUrl))
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(profileInfo.ModelDescription))
 | 
			
		||||
            {
 | 
			
		||||
                if (!Regex.IsMatch(deviceInfo.ModelDescription, profileInfo.ModelDescription))
 | 
			
		||||
                if (deviceInfo.ModelDescription == null || !Regex.IsMatch(deviceInfo.ModelDescription, profileInfo.ModelDescription))
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(profileInfo.ModelName))
 | 
			
		||||
            {
 | 
			
		||||
                if (!Regex.IsMatch(deviceInfo.ModelName, profileInfo.ModelName))
 | 
			
		||||
                if (deviceInfo.ModelName == null || !Regex.IsMatch(deviceInfo.ModelName, profileInfo.ModelName))
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(profileInfo.ModelNumber))
 | 
			
		||||
            {
 | 
			
		||||
                if (!Regex.IsMatch(deviceInfo.ModelNumber, profileInfo.ModelNumber))
 | 
			
		||||
                if (deviceInfo.ModelNumber == null || !Regex.IsMatch(deviceInfo.ModelNumber, profileInfo.ModelNumber))
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(profileInfo.ModelUrl))
 | 
			
		||||
            {
 | 
			
		||||
                if (!Regex.IsMatch(deviceInfo.ModelUrl, profileInfo.ModelUrl))
 | 
			
		||||
                if (deviceInfo.ModelUrl == null || !Regex.IsMatch(deviceInfo.ModelUrl, profileInfo.ModelUrl))
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!string.IsNullOrWhiteSpace(profileInfo.SerialNumber))
 | 
			
		||||
            {
 | 
			
		||||
                if (!Regex.IsMatch(deviceInfo.SerialNumber, profileInfo.SerialNumber))
 | 
			
		||||
                if (deviceInfo.SerialNumber == null || !Regex.IsMatch(deviceInfo.SerialNumber, profileInfo.SerialNumber))
 | 
			
		||||
                    return false;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -681,6 +681,9 @@ namespace MediaBrowser.Dlna.PlayTo
 | 
			
		||||
            var presentationUrl = document.Descendants(uPnpNamespaces.ud.GetName("presentationURL")).FirstOrDefault();
 | 
			
		||||
            if (presentationUrl != null)
 | 
			
		||||
                deviceProperties.PresentationUrl = presentationUrl.Value;
 | 
			
		||||
            var modelUrl = document.Descendants(uPnpNamespaces.ud.GetName("modelURL")).FirstOrDefault();
 | 
			
		||||
            if (modelUrl != null)
 | 
			
		||||
                deviceProperties.ModelUrl = modelUrl.Value;
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            deviceProperties.BaseUrl = String.Format("http://{0}:{1}", url.Host, url.Port);
 | 
			
		||||
 | 
			
		||||
@ -34,6 +34,8 @@ namespace MediaBrowser.Dlna.PlayTo
 | 
			
		||||
 | 
			
		||||
        public string ModelNumber { get; set; }
 | 
			
		||||
 | 
			
		||||
        public string ModelUrl { get; set; }
 | 
			
		||||
 | 
			
		||||
        public string Manufacturer { get; set; }
 | 
			
		||||
 | 
			
		||||
        public string ManufacturerUrl { get; set; }
 | 
			
		||||
@ -72,7 +74,8 @@ namespace MediaBrowser.Dlna.PlayTo
 | 
			
		||||
                ModelName = ModelName,
 | 
			
		||||
                ModelNumber = ModelNumber,
 | 
			
		||||
                FriendlyName = Name,
 | 
			
		||||
                ManufacturerUrl = ManufacturerUrl
 | 
			
		||||
                ManufacturerUrl = ManufacturerUrl,
 | 
			
		||||
                ModelUrl = ModelUrl
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user