format path from artist and filename
parent
7c24564cfa
commit
a6d270b7a4
|
@ -145,8 +145,14 @@ public class BeetsFetcher {
|
|||
case "id":
|
||||
item.setID(reader.nextInt());
|
||||
break;
|
||||
case "path":
|
||||
item.setPath(reader.nextString());
|
||||
case "format":
|
||||
item.setFormat(reader.nextString());
|
||||
break;
|
||||
case "title":
|
||||
item.setTitle(reader.nextString());
|
||||
break;
|
||||
case "artist":
|
||||
item.setArtist(reader.nextString());
|
||||
break;
|
||||
default:
|
||||
reader.skipValue();
|
||||
|
|
|
@ -4,6 +4,9 @@ public class Item {
|
|||
|
||||
private int id;
|
||||
private String path;
|
||||
private String artist;
|
||||
private String title;
|
||||
private String format;
|
||||
|
||||
public int getID() {
|
||||
return id;
|
||||
|
@ -14,10 +17,32 @@ public class Item {
|
|||
}
|
||||
|
||||
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) {
|
||||
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