mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-31 14:33:50 -04:00
Nightly Issues (2) (#2619)
This commit is contained in:
parent
a9cde5eaf7
commit
601acf5a84
@ -643,6 +643,7 @@ public class ScrobblingService : IScrobblingService
|
|||||||
.Concat(addToWantToRead.Select(r => r.AppUser))
|
.Concat(addToWantToRead.Select(r => r.AppUser))
|
||||||
.Concat(removeWantToRead.Select(r => r.AppUser))
|
.Concat(removeWantToRead.Select(r => r.AppUser))
|
||||||
.Concat(ratingEvents.Select(r => r.AppUser))
|
.Concat(ratingEvents.Select(r => r.AppUser))
|
||||||
|
.Where(user => !string.IsNullOrEmpty(user.AniListAccessToken))
|
||||||
.DistinctBy(u => u.Id)
|
.DistinctBy(u => u.Id)
|
||||||
.ToList();
|
.ToList();
|
||||||
foreach (var user in usersToScrobble)
|
foreach (var user in usersToScrobble)
|
||||||
@ -886,6 +887,7 @@ public class ScrobblingService : IScrobblingService
|
|||||||
|
|
||||||
private async Task<int> SetAndCheckRateLimit(IDictionary<int, int> userRateLimits, AppUser user, string license)
|
private async Task<int> SetAndCheckRateLimit(IDictionary<int, int> userRateLimits, AppUser user, string license)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(user.AniListAccessToken)) return 0;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (!userRateLimits.ContainsKey(user.Id))
|
if (!userRateLimits.ContainsKey(user.Id))
|
||||||
|
@ -15,7 +15,13 @@ function generateChecksum(str, algorithm, encoding) {
|
|||||||
const result = {};
|
const result = {};
|
||||||
|
|
||||||
glob.sync(`${jsonFilesDir}**/*.json`).forEach(path => {
|
glob.sync(`${jsonFilesDir}**/*.json`).forEach(path => {
|
||||||
const [_, lang] = path.split('dist\\browser\\assets\\langs\\');
|
console.log('Calculating hash for ', path);
|
||||||
|
let tokens = path.split('dist\\browser\\assets\\langs\\');
|
||||||
|
if (tokens.length === 1) {
|
||||||
|
tokens = path.split('dist/browser/assets/langs/');
|
||||||
|
}
|
||||||
|
const lang = tokens[1];
|
||||||
|
console.log('Language: ', lang);
|
||||||
const content = fs.readFileSync(path, { encoding: 'utf-8' });
|
const content = fs.readFileSync(path, { encoding: 'utf-8' });
|
||||||
result[lang.replace('.json', '')] = generateChecksum(content);
|
result[lang.replace('.json', '')] = generateChecksum(content);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user