Commit 12bddfe4c1a936bc8a0bcca8934fb9b9406df8de

Authored by Imanol-Mikel Barba Sabariego
1 parent 8885baa7

Omisión de ficheros ocultos

res/values/strings.xml
... ... @@ -5,8 +5,8 @@
5 5 <string name="title_activity_main">UPC NEWS</string>
6 6 <string name="descarregar">Start Application</string>
7 7 <string name="hint">Click to Start or go to Settings for Help</string>
8   - <string name="url">URL server</string>
9   - <string name="urlhint">Set the route from the server (without http://)</string>
  8 + <string name="url">Server URL</string>
  9 + <string name="urlhint">Set the server route (without http://)</string>
10 10 <string name="prefs">Preferences</string>
11 11 <string name="help">Help!</string>
12 12 <string name="desc">Play</string>
... ...
src/com/upc/pbe/upcnews/HTMLParser.java
... ... @@ -90,11 +90,24 @@ public class HTMLParser
90 90 filepath = filepath.substring(0, filepath.indexOf("\"")); //Quitamos la morralla del final, nos queda el valor de href sólo.
91 91 if(filepath.endsWith(".m3u8")) //Mira que sea una lista.
92 92 {
93   - if(!resources.contains(filepath)) //No seamos repetitivos
  93 + String filename;
  94 + //Deteccion de ficheros ocultos
  95 + if(filepath.indexOf("/") != -1)
94 96 {
95   - resources.add(filepath);
  97 + filename = filepath.substring(filepath.lastIndexOf("/"));
  98 + }
  99 + else
  100 + {
  101 + filename = filepath;
  102 + }
  103 + if(!filename.startsWith("."))
  104 + {
  105 + if(!resources.contains(filepath)) //No seamos repetitivos
  106 + {
  107 + resources.add(filepath);
  108 + }
  109 + Log.d(TAG, "PLAYLIST FOUND: " + filepath);
96 110 }
97   - Log.d(TAG, "PLAYLIST FOUND: " + filepath);
98 111 }
99 112 }
100 113 }
... ...
src/com/upc/pbe/upcnews/Parser.java
... ... @@ -159,7 +159,7 @@ public class Parser
159 159 {
160 160 if (line.substring(0, 4).equals("#EXT"))
161 161 {
162   - if (expectSegment)
  162 + if (expectSegment && !line.startsWith("#EXT-X-BYTERANGE"))
163 163 {
164 164 throw new ErrorException("Expected segment URI, got an EXT-TAG instead");
165 165 }
... ...