Package com.tagtraum.ubermusic.bandcamp
Class Bandcamp
- java.lang.Object
-
- com.tagtraum.core.WebService
-
- com.tagtraum.ubermusic.bandcamp.Bandcamp
-
- All Implemented Interfaces:
TagProvider
public class Bandcamp extends WebService implements TagProvider
Very limited support for bandcamp as metadata provider. Relies on screenscraping and may therefore break.- Author:
- Hendrik Schreiber
-
-
Field Summary
-
Fields inherited from class com.tagtraum.core.WebService
HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_PUT
-
-
Constructor Summary
Constructors Constructor Description Bandcamp()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Tag>
getTags(AudioSong song)
Retrieves a list of tags for a given song.List<Tag>
getTags(URL bandcampURL)
Parse tags from a bandcamp site.-
Methods inherited from class com.tagtraum.core.WebService
cacheResource, clearCache, getCache, getConnectTimeOut, getDomFactory, getJSONArray, getJSONArray, getJSONObject, getJSONObject, getJSONObjectWithPayload, getMaxAge, getReadTimeOut, getRequestDelay, getSSLSocketFactory, getUserAgent, getXmlDocument, getXmlObject, handleStatusCode, isAcceptGzipContentEncoding, openConnection, openConnection, openInputStream, readURL, setAcceptGzipContentEncoding, setCache, setConnectTimeOut, setDomFactory, setMaxAge, setNextAllowedConnection, setReadTimeOut, setRequestDelay, setSSLSocketFactory, setUserAgent, toParameterString, useCacheOnly, waitForTurn
-
-
-
-
Method Detail
-
getTags
public List<Tag> getTags(AudioSong song) throws IOException
Retrieves a list of tags for a given song. Lookup is based onAudioId
. If available, theAudioId.BANDCAMP_TRACK_URL
is used, if not, theAudioId.BANDCAMP_ARTIST_URL
or theAudioId.BANDCAMP_ALBUM_URL
. If no ids are available, the commment field is parsed.- Specified by:
getTags
in interfaceTagProvider
- Parameters:
song
- song- Returns:
- List, may be empty but never
null
- Throws:
IOException
- if an IO problem occurs
-
getTags
public List<Tag> getTags(URL bandcampURL) throws IOException
Parse tags from a bandcamp site.- Parameters:
bandcampURL
- e.g. http://carseatheadrest.bandcamp.com- Returns:
- list of tags
- Throws:
IOException
- if something goes wrong
-
-