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,11 +20,14 @@ public class Parser{
20 private boolean expectList = false; 20 private boolean expectList = false;
21 private Descarrega download; 21 private Descarrega download;
22 private Activity caller; //On enviar les notificacions i warnings 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 public Parser(String p, Activity caller){ 26 public Parser(String p, Activity caller){
26 this.caller = caller; 27 this.caller = caller;
27 path = p; 28 path = p;
  29 + String host = p.substring(7);
  30 + server = host.substring(0,host.indexOf("/"));
28 currentLine = 0; 31 currentLine = 0;
29 currentSegment = 0; 32 currentSegment = 0;
30 currentList = 0; 33 currentList = 0;
@@ -355,6 +358,14 @@ public class Parser{ @@ -355,6 +358,14 @@ public class Parser{
355 if (expectSegment){ 358 if (expectSegment){
356 expectSegment = false; 359 expectSegment = false;
357 try{ 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 pls.getSegments().get(currentSegment).setURL(line); 369 pls.getSegments().get(currentSegment).setURL(line);
359 } 370 }
360 catch (MalformedURLException e){ 371 catch (MalformedURLException e){