From 12bddfe4c1a936bc8a0bcca8934fb9b9406df8de Mon Sep 17 00:00:00 2001 From: Equip de Desenvolupadors de PBE Date: Sat, 8 Dec 2012 10:51:07 +0000 Subject: [PATCH] Omisión de ficheros ocultos --- res/values/strings.xml | 4 ++-- src/com/upc/pbe/upcnews/HTMLParser.java | 19 ++++++++++++++++--- src/com/upc/pbe/upcnews/Parser.java | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index bade7a9..0fb6cbf 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -5,8 +5,8 @@ UPC NEWS Start Application Click to Start or go to Settings for Help - URL server - Set the route from the server (without http://) + Server URL + Set the server route (without http://) Preferences Help! Play diff --git a/src/com/upc/pbe/upcnews/HTMLParser.java b/src/com/upc/pbe/upcnews/HTMLParser.java index d020572..5fbf19f 100644 --- a/src/com/upc/pbe/upcnews/HTMLParser.java +++ b/src/com/upc/pbe/upcnews/HTMLParser.java @@ -90,11 +90,24 @@ public class HTMLParser filepath = filepath.substring(0, filepath.indexOf("\"")); //Quitamos la morralla del final, nos queda el valor de href sólo. if(filepath.endsWith(".m3u8")) //Mira que sea una lista. { - if(!resources.contains(filepath)) //No seamos repetitivos + String filename; + //Deteccion de ficheros ocultos + if(filepath.indexOf("/") != -1) { - resources.add(filepath); + filename = filepath.substring(filepath.lastIndexOf("/")); + } + else + { + filename = filepath; + } + if(!filename.startsWith(".")) + { + if(!resources.contains(filepath)) //No seamos repetitivos + { + resources.add(filepath); + } + Log.d(TAG, "PLAYLIST FOUND: " + filepath); } - Log.d(TAG, "PLAYLIST FOUND: " + filepath); } } } diff --git a/src/com/upc/pbe/upcnews/Parser.java b/src/com/upc/pbe/upcnews/Parser.java index 7e6b7c9..b906b0d 100644 --- a/src/com/upc/pbe/upcnews/Parser.java +++ b/src/com/upc/pbe/upcnews/Parser.java @@ -159,7 +159,7 @@ public class Parser { if (line.substring(0, 4).equals("#EXT")) { - if (expectSegment) + if (expectSegment && !line.startsWith("#EXT-X-BYTERANGE")) { throw new ErrorException("Expected segment URI, got an EXT-TAG instead"); } -- libgit2 0.22.2