use of org.libresonic.player.domain.MusicFolder in project libresonic by Libresonic.
the class MultiService method getSimilarArtists.
private List<SimilarArtist> getSimilarArtists(int mediaFileId, int limit) {
HttpServletRequest request = WebContextFactory.get().getHttpServletRequest();
String username = securityService.getCurrentUsername(request);
List<MusicFolder> musicFolders = settingsService.getMusicFoldersForUser(username);
MediaFile artist = mediaFileService.getMediaFile(mediaFileId);
List<MediaFile> similarArtists = lastFmService.getSimilarArtists(artist, limit, false, musicFolders);
SimilarArtist[] result = new SimilarArtist[similarArtists.size()];
for (int i = 0; i < result.length; i++) {
MediaFile similarArtist = similarArtists.get(i);
result[i] = new SimilarArtist(similarArtist.getId(), similarArtist.getName());
}
return Arrays.asList(result);
}
use of org.libresonic.player.domain.MusicFolder in project libresonic by Libresonic.
the class MetaDataParser method isRoot.
private boolean isRoot(File file) {
SettingsService settings = ServiceLocator.getSettingsService();
List<MusicFolder> folders = settings.getAllMusicFolders(false, true);
for (MusicFolder folder : folders) {
if (file.equals(folder.getPath())) {
return true;
}
}
return false;
}
Aggregations