Search in sources :

Example 21 with LastFmUser

use of com.github.hakko.musiccabinet.domain.model.library.LastFmUser in project musiccabinet by hakko.

the class StarService method unstarAlbum.

public void unstarAlbum(String lastFmUsername, int albumId) {
    LastFmUser lastFmUser = getLastFmUser(lastFmUsername);
    starDao.unstarAlbum(lastFmUser, albumId);
    getStarredAlbumIds(lastFmUser).remove(albumId);
}
Also used : LastFmUser(com.github.hakko.musiccabinet.domain.model.library.LastFmUser)

Example 22 with LastFmUser

use of com.github.hakko.musiccabinet.domain.model.library.LastFmUser in project musiccabinet by hakko.

the class StarService method starAlbum.

public void starAlbum(String lastFmUsername, int albumId) {
    LastFmUser lastFmUser = getLastFmUser(lastFmUsername);
    starDao.starAlbum(lastFmUser, albumId);
    getStarredAlbumIds(lastFmUser).add(albumId);
}
Also used : LastFmUser(com.github.hakko.musiccabinet.domain.model.library.LastFmUser)

Example 23 with LastFmUser

use of com.github.hakko.musiccabinet.domain.model.library.LastFmUser in project musiccabinet by hakko.

the class StarService method unstarTrack.

public void unstarTrack(String lastFmUsername, int trackId) throws ApplicationException {
    LastFmUser lastFmUser = getLastFmUser(lastFmUsername);
    starDao.unstarTrack(lastFmUser, trackId);
    getStarredTracks(lastFmUser).remove(trackId);
    if (lastFmSettingsService.isSyncStarredAndLovedTracks()) {
        trackUnLoveClient.unlove(browserDao.getTrack(trackId), lastFmUser);
    }
}
Also used : LastFmUser(com.github.hakko.musiccabinet.domain.model.library.LastFmUser)

Example 24 with LastFmUser

use of com.github.hakko.musiccabinet.domain.model.library.LastFmUser in project musiccabinet by hakko.

the class StarService method starTrack.

public void starTrack(String lastFmUsername, int trackId) throws ApplicationException {
    LastFmUser lastFmUser = getLastFmUser(lastFmUsername);
    starDao.starTrack(lastFmUser, trackId);
    getStarredTracks(lastFmUser).add(trackId);
    if (lastFmSettingsService.isSyncStarredAndLovedTracks()) {
        trackLoveClient.love(browserDao.getTrack(trackId), lastFmUser);
    }
}
Also used : LastFmUser(com.github.hakko.musiccabinet.domain.model.library.LastFmUser)

Example 25 with LastFmUser

use of com.github.hakko.musiccabinet.domain.model.library.LastFmUser in project musiccabinet by hakko.

the class TagUpdateService method updateTag.

/*
	 * Async method that registers tag updates for later submission, in case
	 * last.fm is down.
	 */
public void updateTag(Artist artist, String lastFmUsername, String tagName, int tagCount, boolean increase) {
    LastFmUser lastFmUser = lastFmDao.getLastFmUser(lastFmUsername);
    register(new ArtistUserTag(artist, lastFmUser, tagName, tagCount, increase));
    if (!started.getAndSet(true)) {
        startTagUpdateService();
    }
}
Also used : ArtistUserTag(com.github.hakko.musiccabinet.domain.model.aggr.ArtistUserTag) LastFmUser(com.github.hakko.musiccabinet.domain.model.library.LastFmUser)

Aggregations

LastFmUser (com.github.hakko.musiccabinet.domain.model.library.LastFmUser)35 Test (org.junit.Test)14 Track (com.github.hakko.musiccabinet.domain.model.music.Track)9 WebserviceInvocation (com.github.hakko.musiccabinet.domain.model.library.WebserviceInvocation)7 ApplicationException (com.github.hakko.musiccabinet.exception.ApplicationException)7 WSResponse (com.github.hakko.musiccabinet.ws.lastfm.WSResponse)7 NameValuePair (org.apache.http.NameValuePair)6 Scrobble (com.github.hakko.musiccabinet.domain.model.aggr.Scrobble)4 Artist (com.github.hakko.musiccabinet.domain.model.music.Artist)4 Before (org.junit.Before)4 Period (com.github.hakko.musiccabinet.domain.model.library.Period)3 Calltype (com.github.hakko.musiccabinet.domain.model.library.WebserviceInvocation.Calltype)3 WebserviceHistoryService (com.github.hakko.musiccabinet.service.lastfm.WebserviceHistoryService)3 ResourceUtil (com.github.hakko.musiccabinet.util.ResourceUtil)3 StringUtil (com.github.hakko.musiccabinet.util.StringUtil)3 ArrayList (java.util.ArrayList)3 UserStarredTrack (com.github.hakko.musiccabinet.domain.model.aggr.UserStarredTrack)2 UserTopArtists (com.github.hakko.musiccabinet.domain.model.aggr.UserTopArtists)2 File (com.github.hakko.musiccabinet.domain.model.library.File)2 Album (com.github.hakko.musiccabinet.domain.model.music.Album)2