Skip to content

Commit bae968a

Browse files
residuumhatstand
authored andcommitted
Get constants from somewhere else, if available.
1 parent 02dac0a commit bae968a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/library/libraryquery.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <QtDebug>
2323

2424
#include "core/song.h"
25+
#include "core/timeconstants.h"
2526

2627
QueryOptions::QueryOptions() : max_age_(-1), query_mode_(QueryMode_All) {}
2728

@@ -51,9 +52,7 @@ const QMap<QString, Song::FileType> kFiletypeId = QMap<QString, Song::FileType>(
5152
{"stream", Song::Type_Stream},
5253
{"unknown", Song::Type_Unknown}});
5354

54-
const int kNsecsPerSec = 1e9;
5555
const QString kAllowedChars = "smhd";
56-
const int kSecsPerDay = 60 * 60 * 24;
5756

5857
LibraryQuery::LibraryQuery(const QueryOptions& options)
5958
: include_unavailable_(false), join_with_fts_(false), limit_(-1) {
@@ -110,9 +109,9 @@ LibraryQuery::LibraryQuery(const QueryOptions& options)
110109
AddWhere(columntoken, doubleVal, op);
111110
}
112111
} else if (columntoken == "length") {
113-
double seconds = GetSecondsFromToken(val);
112+
qint64 seconds = GetSecondsFromToken(val);
114113
if (seconds > 0) {
115-
double nanoseconds = seconds * kNsecsPerSec;
114+
qint64 nanoseconds = seconds * kNsecPerSec;
116115
AddWhere(columntoken, nanoseconds, op);
117116
}
118117
} else if (columntoken == "filetype") {

0 commit comments

Comments
 (0)