Enable checkstyle OverloadMethodsDeclarationOrder
This commit is contained in:
@@ -47,6 +47,10 @@ public class AlbumDao extends AbstractDao {
|
||||
|
||||
private final RowMapper rowMapper = new AlbumMapper();
|
||||
|
||||
public Album getAlbum(int id) {
|
||||
return queryOne("select " + QUERY_COLUMNS + " from album where id=?", rowMapper, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the album with the given artist and album name.
|
||||
*
|
||||
@@ -90,10 +94,6 @@ public class AlbumDao extends AbstractDao {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Album getAlbum(int id) {
|
||||
return queryOne("select " + QUERY_COLUMNS + " from album where id=?", rowMapper, id);
|
||||
}
|
||||
|
||||
public List<Album> getAlbumsForArtist(final String artist, final List<MusicFolder> musicFolders) {
|
||||
if (musicFolders.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -236,6 +236,28 @@ public class LastFmService {
|
||||
return getArtistBio(getCanonicalArtistName(artist.getName()), locale);
|
||||
}
|
||||
|
||||
private ArtistBio getArtistBio(String artistName, Locale locale) {
|
||||
try {
|
||||
if (artistName == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Artist info = Artist.getInfo(artistName, locale, null /* username */, LAST_FM_KEY);
|
||||
if (info == null) {
|
||||
return null;
|
||||
}
|
||||
return new ArtistBio(processWikiText(info.getWikiSummary()),
|
||||
info.getMbid(),
|
||||
info.getUrl(),
|
||||
info.getImageURL(ImageSize.MEDIUM),
|
||||
info.getImageURL(ImageSize.LARGE),
|
||||
info.getImageURL(ImageSize.MEGA));
|
||||
} catch (Throwable x) {
|
||||
LOG.warn("Failed to find artist bio for " + artistName, x);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns top songs for the given artist, using last.fm REST API.
|
||||
*
|
||||
@@ -368,29 +390,6 @@ public class LastFmService {
|
||||
return imageUrl == null ? null : new LastFmCoverArt(imageUrl, album.getArtist(), album.getName());
|
||||
}
|
||||
|
||||
|
||||
private ArtistBio getArtistBio(String artistName, Locale locale) {
|
||||
try {
|
||||
if (artistName == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Artist info = Artist.getInfo(artistName, locale, null /* username */, LAST_FM_KEY);
|
||||
if (info == null) {
|
||||
return null;
|
||||
}
|
||||
return new ArtistBio(processWikiText(info.getWikiSummary()),
|
||||
info.getMbid(),
|
||||
info.getUrl(),
|
||||
info.getImageURL(ImageSize.MEDIUM),
|
||||
info.getImageURL(ImageSize.LARGE),
|
||||
info.getImageURL(ImageSize.MEGA));
|
||||
} catch (Throwable x) {
|
||||
LOG.warn("Failed to find artist bio for " + artistName, x);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private String getCanonicalArtistName(String artistName) {
|
||||
try {
|
||||
if (artistName == null) {
|
||||
|
||||
@@ -118,15 +118,6 @@ public class MediaFileService {
|
||||
return result;
|
||||
}
|
||||
|
||||
private MediaFile checkLastModified(MediaFile mediaFile, boolean useFastCache) {
|
||||
if (useFastCache || (mediaFile.getVersion() >= MediaFileDao.VERSION && mediaFile.getChanged().getTime() >= FileUtil.lastModified(mediaFile.getFile()))) {
|
||||
return mediaFile;
|
||||
}
|
||||
mediaFile = createMediaFile(mediaFile.getFile());
|
||||
mediaFileDao.createOrUpdateMediaFile(mediaFile);
|
||||
return mediaFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a media file instance for the given path name. If possible, a cached value is returned.
|
||||
*
|
||||
@@ -159,6 +150,15 @@ public class MediaFileService {
|
||||
return getMediaFile(mediaFile.getParentPath());
|
||||
}
|
||||
|
||||
private MediaFile checkLastModified(MediaFile mediaFile, boolean useFastCache) {
|
||||
if (useFastCache || (mediaFile.getVersion() >= MediaFileDao.VERSION && mediaFile.getChanged().getTime() >= FileUtil.lastModified(mediaFile.getFile()))) {
|
||||
return mediaFile;
|
||||
}
|
||||
mediaFile = createMediaFile(mediaFile.getFile());
|
||||
mediaFileDao.createOrUpdateMediaFile(mediaFile);
|
||||
return mediaFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all media files that are children of a given media file.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user