Fixed regression when adding all from search results
This commit is contained in:
@@ -20,8 +20,9 @@
|
||||
#include "ArtistCollector.hpp"
|
||||
|
||||
#include "services/database/Artist.hpp"
|
||||
#include "services/database/User.hpp"
|
||||
#include "services/database/Session.hpp"
|
||||
#include "services/database/TrackList.hpp"
|
||||
#include "services/database/User.hpp"
|
||||
#include "services/scrobbling/IScrobblingService.hpp"
|
||||
#include "utils/Service.hpp"
|
||||
#include "Filters.hpp"
|
||||
@@ -65,7 +66,10 @@ namespace UserInterface
|
||||
params.setSortMethod(ArtistSortMethod::LastWritten);
|
||||
params.setRange(range);
|
||||
|
||||
artists = Artist::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
artists = Artist::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -77,7 +81,10 @@ namespace UserInterface
|
||||
params.setSortMethod(ArtistSortMethod::BySortName);
|
||||
params.setRange(range);
|
||||
|
||||
artists = Artist::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
artists = Artist::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -89,7 +96,10 @@ namespace UserInterface
|
||||
params.setSortMethod(ArtistSortMethod::BySortName);
|
||||
params.setRange(range);
|
||||
|
||||
artists = Artist::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
artists = Artist::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +123,10 @@ namespace UserInterface
|
||||
params.setSortMethod(ArtistSortMethod::Random);
|
||||
params.setRange(Range {0, getMaxCount()});
|
||||
|
||||
_randomArtists = Artist::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
_randomArtists = Artist::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
}
|
||||
|
||||
return _randomArtists->getSubRange(range);
|
||||
|
||||
@@ -67,7 +67,10 @@ namespace UserInterface
|
||||
params.setSortMethod(ReleaseSortMethod::LastWritten);
|
||||
params.setRange(range);
|
||||
|
||||
releases = Release::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
releases = Release::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -79,7 +82,10 @@ namespace UserInterface
|
||||
params.setSortMethod(ReleaseSortMethod::Name);
|
||||
params.setRange(range);
|
||||
|
||||
releases = Release::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
releases = Release::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -90,7 +96,10 @@ namespace UserInterface
|
||||
params.setSortMethod(ReleaseSortMethod::Name);
|
||||
params.setRange(range);
|
||||
|
||||
releases = Release::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
releases = Release::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -112,7 +121,11 @@ namespace UserInterface
|
||||
params.setClusters(getFilters().getClusterIds());
|
||||
params.setSortMethod(ReleaseSortMethod::Random);
|
||||
params.setRange({0, getMaxCount()});
|
||||
_randomReleases = Release::find(LmsApp->getDbSession(), params);
|
||||
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
_randomReleases = Release::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
}
|
||||
|
||||
return _randomReleases->getSubRange(range);
|
||||
|
||||
@@ -66,7 +66,10 @@ namespace UserInterface
|
||||
params.setSortMethod(TrackSortMethod::LastWritten);
|
||||
params.setRange(range);
|
||||
|
||||
tracks = Track::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
tracks = Track::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -77,7 +80,10 @@ namespace UserInterface
|
||||
params.setKeywords(getSearchKeywords());
|
||||
params.setRange(range);
|
||||
|
||||
tracks = Track::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
tracks = Track::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -87,7 +93,10 @@ namespace UserInterface
|
||||
params.setClusters(getFilters().getClusterIds());
|
||||
params.setRange(range);
|
||||
|
||||
tracks = Track::find(LmsApp->getDbSession(), params);
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
tracks = Track::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -109,7 +118,11 @@ namespace UserInterface
|
||||
params.setClusters(getFilters().getClusterIds());
|
||||
params.setSortMethod(TrackSortMethod::Random);
|
||||
params.setRange({0, getMaxCount()});
|
||||
_randomTracks = Track::find(LmsApp->getDbSession(), params);
|
||||
|
||||
{
|
||||
auto transaction {LmsApp->getDbSession().createSharedTransaction()};
|
||||
_randomTracks = Track::find(LmsApp->getDbSession(), params);
|
||||
}
|
||||
}
|
||||
|
||||
return _randomTracks->getSubRange(range);
|
||||
|
||||
Reference in New Issue
Block a user