Skip to content
Browse files

We can now turn of the max scrobble point limit.

  • Loading branch information...
1 parent a7d5e2e commit 60d3773b57db444e7e5c2a4373c30feda7eb2dca @eartle eartle committed
Showing with 20 additions and 5 deletions.
  1. +18 −5 src/ScrobblePoint.cpp
  2. +2 −0 src/ScrobblePoint.h
View
23 src/ScrobblePoint.cpp
@@ -30,6 +30,7 @@ class lastfm::ScrobblePointPrivate
{
public:
uint i;
+ bool enforceScrobbleTimeMax;
};
@@ -37,6 +38,7 @@ lastfm::ScrobblePoint::ScrobblePoint()
: d( new ScrobblePointPrivate )
{
d->i = SCROBBLE_TIME_MAX;
+ d->enforceScrobbleTimeMax = true;
}
@@ -47,15 +49,16 @@ lastfm::ScrobblePoint::ScrobblePoint( uint j )
// cruel and callous people
if (j == 0) --j;
- d->i = qBound( uint(SCROBBLE_TIME_MIN),
- j,
- uint(SCROBBLE_TIME_MAX) );
+ d->i = j;
+ d->enforceScrobbleTimeMax = true;
}
lastfm::ScrobblePoint::ScrobblePoint( const ScrobblePoint& that )
- : d( new ScrobblePointPrivate( *that.d ) )
+ : d( new ScrobblePointPrivate )
{
+ d->i = that.d->i;
+ d->enforceScrobbleTimeMax = that.d->enforceScrobbleTimeMax;
}
@@ -65,9 +68,18 @@ lastfm::ScrobblePoint::~ScrobblePoint()
}
+void
+lastfm::ScrobblePoint::setEnforceScrobbleTimeMax( bool enforceScrobbleTimeMax )
+{
+ d->enforceScrobbleTimeMax = enforceScrobbleTimeMax;
+}
+
+
lastfm::ScrobblePoint::operator uint() const
{
- return d->i;
+ return qBound( uint(SCROBBLE_TIME_MIN),
+ d->i,
+ d->enforceScrobbleTimeMax ? uint(SCROBBLE_TIME_MAX) : 0xFFFFFFFF );
}
@@ -75,6 +87,7 @@ lastfm::ScrobblePoint&
lastfm::ScrobblePoint::operator=( const ScrobblePoint& that )
{
d->i = that.d->i;
+ d->enforceScrobbleTimeMax = that.d->enforceScrobbleTimeMax;
return *this;
}
View
2 src/ScrobblePoint.h
@@ -38,6 +38,8 @@ class LASTFM_DLLEXPORT ScrobblePoint
operator uint() const;
ScrobblePoint& operator=( const ScrobblePoint& that );
+ void setEnforceScrobbleTimeMax( bool enforceScrobbleTimeMax );
+
// scrobbles can occur between these two percentages of track duration
static uint scrobblePercentMin(); // 50
static uint scrobblePercentMax(); // 100

0 comments on commit 60d3773

Please sign in to comment.
Something went wrong with that request. Please try again.