mirror of
https://github.com/Radarr/Radarr
synced 2025-02-23 06:41:20 +00:00
Added: Last round of optimisation. Large libraries should load around 2x faster again compared to the last version.
This commit is contained in:
parent
a9b244bf75
commit
e77d9ce848
5 changed files with 19 additions and 6 deletions
|
@ -124,7 +124,7 @@ protected Func<PagingResource<TResource>, PagingResource<TResource>> GetResource
|
|||
Get[ROOT_ROUTE] = options =>
|
||||
{
|
||||
var pagingSpec = ReadPagingResourceFromRequest();
|
||||
if (pagingSpec.Page == 0 && pagingSpec.PageSize == 0)
|
||||
if ((pagingSpec.Page == 0 && pagingSpec.PageSize == 0) || pagingSpec.PageSize == -1)
|
||||
{
|
||||
var all = GetResourceAll();
|
||||
return all.AsResponse();
|
||||
|
|
|
@ -142,6 +142,9 @@ public static void Map()
|
|||
|
||||
Mapper.Entity<Movie>().RegisterModel("Movies")
|
||||
.Ignore(s => s.RootFolderPath)
|
||||
.Ignore(m => m.Actors)
|
||||
.Ignore(m => m.Genres)
|
||||
.Ignore(m => m.Tags)
|
||||
.Relationship()
|
||||
.HasOne(s => s.Profile, s => s.ProfileId);
|
||||
//.HasOne(m => m.MovieFile, m => m.MovieFileId);
|
||||
|
|
|
@ -72,11 +72,11 @@ public void ConvertToLocalUrls(int seriesId, IEnumerable<MediaCover> covers)
|
|||
|
||||
mediaCover.Url = _configFileProvider.UrlBase + @"/MediaCover/" + seriesId + "/" + mediaCover.CoverType.ToString().ToLower() + ".jpg";
|
||||
|
||||
if (_diskProvider.FileExists(filePath))
|
||||
/*if (_diskProvider.FileExists(filePath))
|
||||
{
|
||||
var lastWrite = _diskProvider.FileGetLastWrite(filePath);
|
||||
mediaCover.Url += "?lastWrite=" + lastWrite.Ticks;
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,12 @@ var movieCollection = require('./MoviesCollection');
|
|||
var fullCollection = movieCollection.clone();
|
||||
fullCollection.reset();
|
||||
fullCollection.bindSignalR();
|
||||
fullCollection.state.pageSize = 100000;
|
||||
fullCollection.state.pageSize = -1;
|
||||
fullCollection.state.page = 0;
|
||||
fullCollection.parseRecords = function(resp) {
|
||||
return resp;
|
||||
};
|
||||
|
||||
fullCollection.fetch({reset : true});
|
||||
module.exports = fullCollection;
|
||||
|
||||
|
|
|
@ -85,6 +85,11 @@ var Collection = PageableCollection.extend({
|
|||
if (this.mode === 'client') {
|
||||
return {};
|
||||
}
|
||||
|
||||
if (this.state.pageSize == -1) {
|
||||
return this.state;
|
||||
}
|
||||
|
||||
var direction = -1;
|
||||
if (resp.sortDirection.toLowerCase() === "descending") {
|
||||
direction = 1;
|
||||
|
@ -93,7 +98,7 @@ var Collection = PageableCollection.extend({
|
|||
},
|
||||
|
||||
parseRecords : function(resp) {
|
||||
if (resp && this.mode !== 'client') {
|
||||
if (resp && this.mode !== 'client' && this.state.pageSize != 0 && this.state.pageSize != -1) {
|
||||
return resp.records;
|
||||
}
|
||||
|
||||
|
@ -247,7 +252,7 @@ var Collection = PageableCollection.extend({
|
|||
},
|
||||
|
||||
add : function(model, options) {
|
||||
if (this.length >= this.state.pageSize) {
|
||||
if (this.length >= this.state.pageSize && this.state.pageSize != -1) {
|
||||
return;
|
||||
}
|
||||
this.origAdd.call(this, model, options);
|
||||
|
|
Loading…
Reference in a new issue