format path from artist and filename
parent
7c24564cfa
commit
a6d270b7a4
|
@ -145,8 +145,14 @@ public class BeetsFetcher {
|
||||||
case "id":
|
case "id":
|
||||||
item.setID(reader.nextInt());
|
item.setID(reader.nextInt());
|
||||||
break;
|
break;
|
||||||
case "path":
|
case "format":
|
||||||
item.setPath(reader.nextString());
|
item.setFormat(reader.nextString());
|
||||||
|
break;
|
||||||
|
case "title":
|
||||||
|
item.setTitle(reader.nextString());
|
||||||
|
break;
|
||||||
|
case "artist":
|
||||||
|
item.setArtist(reader.nextString());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
reader.skipValue();
|
reader.skipValue();
|
||||||
|
|
|
@ -4,6 +4,9 @@ public class Item {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
private String path;
|
private String path;
|
||||||
|
private String artist;
|
||||||
|
private String title;
|
||||||
|
private String format;
|
||||||
|
|
||||||
public int getID() {
|
public int getID() {
|
||||||
return id;
|
return id;
|
||||||
|
@ -14,10 +17,32 @@ public class Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPath() {
|
public String getPath() {
|
||||||
return path;
|
if (path != null) {
|
||||||
|
return path;
|
||||||
|
} else {
|
||||||
|
return "/" + artist + "/" + title + "_" + id + "." + format.toLowerCase();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public String getArtist() {
|
||||||
|
return artist;
|
||||||
|
}
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
public String getFormat() {
|
||||||
|
return format;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPath(String path) {
|
public void setPath(String path) {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
}
|
}
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
public void setFormat(String format) {
|
||||||
|
this.format = format;
|
||||||
|
}
|
||||||
|
public void setArtist(String artist) {
|
||||||
|
this.artist = artist;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue