Add database property to AudioTrack object
This commit is contained in:
parent
2a039350e4
commit
83b0f999d9
|
@ -120,7 +120,7 @@ public class AcoustIDClient implements MusicIdentificationService {
|
||||||
if (artist == null || title == null || releaseGroup.isEmpty())
|
if (artist == null || title == null || releaseGroup.isEmpty())
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
AudioTrack audioTrack = new AudioTrack(artist, title, null);
|
AudioTrack audioTrack = new AudioTrack(artist, title, null, getIdentifier());
|
||||||
audioTrack.mbid = getString(result, "id");
|
audioTrack.mbid = getString(result, "id");
|
||||||
|
|
||||||
String type = getString(releaseGroup, "type");
|
String type = getString(releaseGroup, "type");
|
||||||
|
|
|
@ -4,6 +4,8 @@ import java.io.Serializable;
|
||||||
|
|
||||||
public class AudioTrack implements Serializable {
|
public class AudioTrack implements Serializable {
|
||||||
|
|
||||||
|
protected String database;
|
||||||
|
|
||||||
protected String artist;
|
protected String artist;
|
||||||
protected String title;
|
protected String title;
|
||||||
protected String album;
|
protected String album;
|
||||||
|
@ -33,15 +35,17 @@ public class AudioTrack implements Serializable {
|
||||||
this.trackIndex = other.trackIndex;
|
this.trackIndex = other.trackIndex;
|
||||||
this.trackCount = other.trackCount;
|
this.trackCount = other.trackCount;
|
||||||
this.mbid = other.mbid;
|
this.mbid = other.mbid;
|
||||||
|
this.database = other.database;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AudioTrack(String artist, String title, String album) {
|
public AudioTrack(String artist, String title, String album, String database) {
|
||||||
this.artist = artist;
|
this.artist = artist;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.album = album;
|
this.album = album;
|
||||||
|
this.database = database;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AudioTrack(String artist, String title, String album, String albumArtist, String trackTitle, SimpleDate albumReleaseDate, Integer mediumIndex, Integer mediumCount, Integer trackIndex, Integer trackCount, String mbid) {
|
public AudioTrack(String artist, String title, String album, String albumArtist, String trackTitle, SimpleDate albumReleaseDate, Integer mediumIndex, Integer mediumCount, Integer trackIndex, Integer trackCount, String mbid, String database) {
|
||||||
this.artist = artist;
|
this.artist = artist;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.album = album;
|
this.album = album;
|
||||||
|
@ -53,6 +57,7 @@ public class AudioTrack implements Serializable {
|
||||||
this.trackIndex = trackIndex;
|
this.trackIndex = trackIndex;
|
||||||
this.trackCount = trackCount;
|
this.trackCount = trackCount;
|
||||||
this.mbid = mbid;
|
this.mbid = mbid;
|
||||||
|
this.database = database;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getArtist() {
|
public String getArtist() {
|
||||||
|
@ -99,6 +104,10 @@ public class AudioTrack implements Serializable {
|
||||||
return mbid;
|
return mbid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDatabase() {
|
||||||
|
return database;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AudioTrack clone() {
|
public AudioTrack clone() {
|
||||||
return new AudioTrack(this);
|
return new AudioTrack(this);
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
|
|
||||||
package net.filebot.web;
|
package net.filebot.web;
|
||||||
|
|
||||||
|
|
||||||
import java.text.FieldPosition;
|
import java.text.FieldPosition;
|
||||||
import java.text.Format;
|
import java.text.Format;
|
||||||
import java.text.ParsePosition;
|
import java.text.ParsePosition;
|
||||||
|
|
||||||
|
|
||||||
public class AudioTrackFormat extends Format {
|
public class AudioTrackFormat extends Format {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -14,13 +12,12 @@ public class AudioTrackFormat extends Format {
|
||||||
return sb.append(obj.toString());
|
return sb.append(obj.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AudioTrack parseObject(String source, ParsePosition pos) {
|
public AudioTrack parseObject(String source, ParsePosition pos) {
|
||||||
String[] s = source.split(" - ", 2);
|
String[] s = source.split(" - ", 2);
|
||||||
if (s.length == 2) {
|
if (s.length == 2) {
|
||||||
pos.setIndex(source.length());
|
pos.setIndex(source.length());
|
||||||
return new AudioTrack(s[0].trim(), s[1].trim(), "VA");
|
return new AudioTrack(s[0].trim(), s[1].trim(), "VA", null);
|
||||||
} else {
|
} else {
|
||||||
pos.setErrorIndex(0);
|
pos.setErrorIndex(0);
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class ID3Lookup implements MusicIdentificationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
info.put(f, new AudioTrack(artist, title, album, albumArtist, trackTitle, albumReleaseDate, mediumIndex, mediumCount, trackIndex, trackCount, mbid));
|
info.put(f, new AudioTrack(artist, title, album, albumArtist, trackTitle, albumReleaseDate, mediumIndex, mediumCount, trackIndex, trackCount, mbid, getIdentifier()));
|
||||||
}
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
debug.warning(e.getMessage());
|
debug.warning(e.getMessage());
|
||||||
|
|
Loading…
Reference in New Issue