Package com.tagtraum.ubermusic.discogs
Class DiscogsOffline
- java.lang.Object
-
- com.tagtraum.ubermusic.discogs.DiscogsOffline
-
- All Implemented Interfaces:
UberMusic
public class DiscogsOffline extends Object implements UberMusic
Allows offline searching of Master Discogs data from here. Returned matches are guaranteed to match the album name, but not necessarily the artist. Results are sorted by Levenshtein distance to the query.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description DiscogsOffline()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
build(File inFile)
Create the (super-simple) database used byfindMatchingMasterIds(com.tagtraum.audiokern.AudioSong)
.protected void
finalize()
List<Long>
findMatchingMasterIds(AudioSong song)
Offline search for master ids that match the query song.SortedSet<com.tagtraum.ubermusic.discogs.DiscogsOffline.Result>
findMatchingMasters(AudioSong song)
Path
getDatabaseFile()
List<AudioSong>
lookup(AudioSong song)
Offline search for artist/album combinations and album ids that match the query song.static void
main(String[] args)
void
setDatabaseFile(Path databaseFile)
void
shutdown()
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tagtraum.ubermusic.UberMusic
getArtists, getSimilarArtists, lookup, lookup
-
-
-
-
Method Detail
-
getDatabaseFile
public Path getDatabaseFile()
-
setDatabaseFile
public void setDatabaseFile(Path databaseFile)
-
shutdown
public void shutdown()
-
finalize
protected void finalize() throws Throwable
-
findMatchingMasterIds
public List<Long> findMatchingMasterIds(AudioSong song)
Offline search for master ids that match the query song. Use search results to look up the actual data viaDiscogs.getMaster(long)
.- Parameters:
song
- query song- Returns:
- master ids, sorted by Levenshtein distance (asc) to the query song.
-
lookup
public List<AudioSong> lookup(AudioSong song)
Offline search for artist/album combinations and album ids that match the query song. All matches at least match the album name. The returnedAudioSong
objects do not deliver much beyondAudioSong.getAlbumArtist()
,AudioSong.getAlbum()
, andAudioSong.getAlbumIds()
.
-
findMatchingMasters
public SortedSet<com.tagtraum.ubermusic.discogs.DiscogsOffline.Result> findMatchingMasters(AudioSong song)
-
build
public void build(File inFile) throws Exception
Create the (super-simple) database used byfindMatchingMasterIds(com.tagtraum.audiokern.AudioSong)
.
-
-