Skip to content

Commit

Permalink
remove unused addTracksAddFile() overload
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Nov 26, 2024
1 parent 5ce0154 commit cdb91bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/library/dao/trackdao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "util/db/sqlite.h"
#include "util/db/sqlstringformatter.h"
#include "util/db/sqltransaction.h"
#include "util/fileaccess.h"
#include "util/fileinfo.h"
#include "util/logger.h"
#include "util/math.h"
Expand Down Expand Up @@ -813,8 +814,9 @@ TrackId TrackDAO::addTracksAddTrack(const TrackPointer& pTrack, bool unremove) {
}

TrackPointer TrackDAO::addTracksAddFile(
const mixxx::FileAccess& fileAccess,
const QString& filePath,
bool unremove) {
const auto fileAccess = mixxx::FileAccess(mixxx::FileInfo(filePath));
// Check that track is a supported extension.
// TODO(uklotzde): The following check can be skipped if
// the track is already in the library. A refactoring is
Expand All @@ -826,7 +828,7 @@ TrackPointer TrackDAO::addTracksAddFile(
return nullptr;
}

GlobalTrackCacheResolver cacheResolver(fileAccess);
auto cacheResolver = GlobalTrackCacheResolver(fileAccess);
TrackPointer pTrack = cacheResolver.getTrack();
switch (cacheResolver.getLookupResult()) {
case GlobalTrackCacheLookupResult::Hit: {
Expand Down
9 changes: 1 addition & 8 deletions src/library/dao/trackdao.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,9 @@ class TrackDAO : public QObject, public virtual DAO, public virtual GlobalTrackC
TrackId addTracksAddTrack(
const TrackPointer& pTrack,
bool unremove);
TrackPointer addTracksAddFile(
const mixxx::FileAccess& fileAccess,
bool unremove);
TrackPointer addTracksAddFile(
const QString& filePath,
bool unremove) {
return addTracksAddFile(
mixxx::FileAccess(mixxx::FileInfo(filePath)),
unremove);
}
bool unremove);
void addTracksFinish(bool rollback = false);

bool updateTrack(const Track& track) const;
Expand Down

0 comments on commit cdb91bb

Please sign in to comment.