Commit 6b555c4cc05b079e3c2fe508d2393a272b040921

Authored by Imanol-Mikel Barba Sabariego
1 parent d9071b76

Lista de tareas update

src/com/upc/pbe/upcnews/Parser.java
... ... @@ -20,11 +20,14 @@ public class Parser{
20 20 private boolean expectList = false;
21 21 private Descarrega download;
22 22 private Activity caller; //On enviar les notificacions i warnings
23   - private boolean validated; //Indica si la llista comença amb #EXTM3U o no
  23 + private boolean validated; //Indica si la llista comen�a amb #EXTM3U o no
  24 + private String server;
24 25  
25 26 public Parser(String p, Activity caller){
26 27 this.caller = caller;
27 28 path = p;
  29 + String host = p.substring(7);
  30 + server = host.substring(0,host.indexOf("/"));
28 31 currentLine = 0;
29 32 currentSegment = 0;
30 33 currentList = 0;
... ... @@ -355,6 +358,14 @@ public class Parser{
355 358 if (expectSegment){
356 359 expectSegment = false;
357 360 try{
  361 + if(!line.startsWith("http://") && !line.startsWith("/"))
  362 + {
  363 + line = path + line;
  364 + }
  365 + else if(line.startsWith("/"))
  366 + {
  367 + line = server + line;
  368 + }
358 369 pls.getSegments().get(currentSegment).setURL(line);
359 370 }
360 371 catch (MalformedURLException e){
... ...