OSDN Git Service

remove crf flag and all uses of it
[handbrake-jp/handbrake-jp-git.git] / win / C# / Functions / AppcastReader.cs
index 861bd0b..7f1e90b 100644 (file)
@@ -18,18 +18,24 @@ namespace Handbrake.Functions
         /// </summary>\r
         public void getInfo(string input)\r
         {\r
-            // Get the correct Appcast and set input.\r
-            XmlNode nodeItem = readRss(new XmlTextReader(new StringReader(input)));\r
-            string result = nodeItem.InnerXml;\r
+            try\r
+            {\r
+                // Get the correct Appcast and set input.\r
+                XmlNode nodeItem = readRss(new XmlTextReader(new StringReader(input)));\r
+                string result = nodeItem.InnerXml;\r
 \r
-            // Regular Expressions\r
-            Match ver = Regex.Match(result, @"sparkle:version=""([0-9]*)\""");\r
-            Match verShort = Regex.Match(result, @"sparkle:shortVersionString=""([0-9].[0-9].[0-9]*)\""");\r
+                // Regular Expressions\r
+                Match ver = Regex.Match(result, @"sparkle:version=""([0-9]*)\""");\r
+                Match verShort = Regex.Match(result, @"sparkle:shortVersionString=""(([svn]*)([0-9.\s]*))\""");\r
 \r
-            build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");\r
-            version = verShort.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r
-            downloadFile = nodeItem["windows"].InnerText;\r
-            descriptionUrl = new Uri(nodeItem["sparkle:releaseNotesLink"].InnerText);\r
+                build = ver.ToString().Replace("sparkle:version=", "").Replace("\"", "");\r
+                version = verShort.ToString().Replace("sparkle:shortVersionString=", "").Replace("\"", "");\r
+                downloadFile = nodeItem["windows"].InnerText;\r
+                descriptionUrl = new Uri(nodeItem["sparkle:releaseNotesLink"].InnerText);\r
+            } catch( Exception)\r
+            {\r
+                // Ignore Error.\r
+            }\r
         }\r
 \r
         /// <summary>\r