summaryrefslogtreecommitdiffstats
path: root/src/library/dao
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/dao')
-rw-r--r--src/library/dao/trackschema.cpp13
-rw-r--r--src/library/dao/trackschema.h43
2 files changed, 56 insertions, 0 deletions
diff --git a/src/library/dao/trackschema.cpp b/src/library/dao/trackschema.cpp
new file mode 100644
index 0000000000..7f89e9a839
--- /dev/null
+++ b/src/library/dao/trackschema.cpp
@@ -0,0 +1,13 @@
+#include "library/dao/trackschema.h"
+
+namespace mixxx {
+namespace TrackSchema {
+QString tableForColumn(const QString& columnName) {
+ if (columnName == TRACKLOCATIONSTABLE_FSDELETED || columnName == TRACKLOCATIONSTABLE_LOCATION) {
+ return QStringLiteral(TRACKLOCATIONS_TABLE);
+ }
+ // This doesn't detect unknown columns, but that's not really important here.
+ return QStringLiteral(LIBRARY_TABLE);
+}
+} // namespace TrackSchema
+} // namespace mixxx
diff --git a/src/library/dao/trackschema.h b/src/library/dao/trackschema.h
index 0650c9a1f0..0284b4fc6a 100644
--- a/src/library/dao/trackschema.h
+++ b/src/library/dao/trackschema.h
@@ -2,8 +2,10 @@
#define MIXXX_TRACKSCHEMA_H
#include <QString>
+#include <QStringList>
#define LIBRARY_TABLE "library"
+#define TRACKLOCATIONS_TABLE "track_locations"
const QString LIBRARYTABLE_ID = "id";
const QString LIBRARYTABLE_ARTIST = "artist";
@@ -54,4 +56,45 @@ const QString TRACKLOCATIONSTABLE_NEEDSVERIFICATION = "needs_verification";
const QString REKORDBOX_ANALYZE_PATH = "analyze_path";
+const QStringList DEFAULT_COLUMNS = {
+ LIBRARYTABLE_ID,
+ LIBRARYTABLE_PLAYED,
+ LIBRARYTABLE_TIMESPLAYED,
+ //has to be up here otherwise Played and TimesPlayed are not shown
+ LIBRARYTABLE_ALBUMARTIST,
+ LIBRARYTABLE_ALBUM,
+ LIBRARYTABLE_ARTIST,
+ LIBRARYTABLE_TITLE,
+ LIBRARYTABLE_YEAR,
+ LIBRARYTABLE_RATING,
+ LIBRARYTABLE_GENRE,
+ LIBRARYTABLE_COMPOSER,
+ LIBRARYTABLE_GROUPING,
+ LIBRARYTABLE_TRACKNUMBER,
+ LIBRARYTABLE_KEY,
+ LIBRARYTABLE_KEY_ID,
+ LIBRARYTABLE_BPM,
+ LIBRARYTABLE_BPM_LOCK,
+ LIBRARYTABLE_DURATION,
+ LIBRARYTABLE_BITRATE,
+ LIBRARYTABLE_REPLAYGAIN,
+ LIBRARYTABLE_FILETYPE,
+ LIBRARYTABLE_DATETIMEADDED,
+ TRACKLOCATIONSTABLE_LOCATION,
+ TRACKLOCATIONSTABLE_FSDELETED,
+ LIBRARYTABLE_COMMENT,
+ LIBRARYTABLE_MIXXXDELETED,
+ LIBRARYTABLE_COLOR,
+ LIBRARYTABLE_COVERART_SOURCE,
+ LIBRARYTABLE_COVERART_TYPE,
+ LIBRARYTABLE_COVERART_LOCATION,
+ LIBRARYTABLE_COVERART_HASH};
+
+namespace mixxx {
+namespace TrackSchema {
+// TableForColumn returns the name of the table that contains the named column.
+QString tableForColumn(const QString& columnName);
+} // namespace TrackSchema
+} // namespace mixxx
+
#endif //MIXXX_TRACKSCHEMA_H