In Progress Query Update (#145)

* Fixed a bug where chapter cover images weren't being updated due to a missed not.

* Removed a piece of code that was needed for upgrading, since all beta users agreed to wipe db.

* Fixed InProgress to properly respect order and show more recent activity first. Issue is with IEntityDate LastModified not updating in DataContext.

* Updated dependencies to lastest stable.

* LastModified on Volumes wasn't updating, validated it does update when data is changed.
This commit is contained in:
Joseph Milazzo 2021-04-01 16:11:06 -05:00 committed by GitHub
parent ca5c666b7b
commit 7790cf31fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 38 additions and 40 deletions

View file

@ -22,7 +22,7 @@ namespace API.Controllers
const string format = "jpeg";
Response.AddCacheHeader(content);
return File(content, "image/" + format);
return File(content, "image/" + format, $"chapterId");
}
[HttpGet("volume-cover")]
@ -33,7 +33,7 @@ namespace API.Controllers
const string format = "jpeg";
Response.AddCacheHeader(content);
return File(content, "image/" + format);
return File(content, "image/" + format, $"volumeId");
}
[HttpGet("series-cover")]
@ -44,7 +44,7 @@ namespace API.Controllers
const string format = "jpeg";
Response.AddCacheHeader(content);
return File(content, "image/" + format);
return File(content, "image/" + format, $"seriesId");
}
}
}

View file

@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
@ -19,14 +20,16 @@ namespace API.Controllers
private readonly ICacheService _cacheService;
private readonly ILogger<ReaderController> _logger;
private readonly IUnitOfWork _unitOfWork;
private readonly DataContext _dataContext;
public ReaderController(IDirectoryService directoryService, ICacheService cacheService,
ILogger<ReaderController> logger, IUnitOfWork unitOfWork)
ILogger<ReaderController> logger, IUnitOfWork unitOfWork, DataContext dataContext)
{
_directoryService = directoryService;
_cacheService = cacheService;
_logger = logger;
_unitOfWork = unitOfWork;
_dataContext = dataContext;
}
[HttpGet("image")]
@ -218,7 +221,8 @@ namespace API.Controllers
PagesRead = bookmarkDto.PageNum,
VolumeId = bookmarkDto.VolumeId,
SeriesId = bookmarkDto.SeriesId,
ChapterId = bookmarkDto.ChapterId
ChapterId = bookmarkDto.ChapterId,
LastModified = DateTime.Now
});
}
else
@ -226,8 +230,9 @@ namespace API.Controllers
userProgress.PagesRead = bookmarkDto.PageNum;
userProgress.SeriesId = bookmarkDto.SeriesId;
userProgress.VolumeId = bookmarkDto.VolumeId;
userProgress.LastModified = DateTime.Now;
}
_unitOfWork.UserRepository.Update(user);
if (await _unitOfWork.Complete())