summaryrefslogtreecommitdiff
path: root/plugins/lastfm
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/lastfm')
-rw-r--r--plugins/lastfm/lastfm.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/lastfm/lastfm.c b/plugins/lastfm/lastfm.c
index fa36c74d..c725bc9d 100644
--- a/plugins/lastfm/lastfm.c
+++ b/plugins/lastfm/lastfm.c
@@ -549,8 +549,12 @@ lastfm_songchanged (ddb_event_trackchange_t *ev, uintptr_t data) {
// duration/playtime must be >= 30 sec
float dur = deadbeef->pl_get_item_duration (ev->from);
if (dur < 30 && ev->playtime < 30) {
- trace ("track duration is %f sec, playtime if %f sec. not eligible for submission\n", dur, ev->playtime);
- return 0;
+ // the lastfm.send_tiny_tracks option can override this rule
+ // only if the track played fully, and has determined duration
+ if (!(dur > 0 && fabs (ev->playtime - dur) < 1.f && deadbeef->conf_get_int ("lastfm.submit_tiny_tracks", 0))) {
+ trace ("track duration is %f sec, playtime if %f sec. not eligible for submission\n", dur, ev->playtime);
+ return 0;
+ }
}
// must be played for >=240sec or half the total time
if (ev->playtime < 240 && ev->playtime < dur/2) {
@@ -974,6 +978,7 @@ static const char settings_dlg[] =
"property \"Scrobble URL\" entry lastfm.scrobbler_url \""SCROBBLER_URL_LFM"\";"
"property \"Prefer Album Artist over Artist field\" checkbox lastfm.prefer_album_artist 0;"
"property \"Send MusicBrainz ID\" checkbox lastfm.mbid 0;"
+ "property \"Submit tracks shorter than 30 seconds (not recommended)\" checkbox lastfm.submit_tiny_tracks 0;"
;
// define plugin interface