Nightly Issues (2) (#2619)

This commit is contained in:
Joe Milazzo 2024-01-18 12:32:20 -06:00 committed by GitHub
parent a9cde5eaf7
commit 601acf5a84
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -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))

View File

@ -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);
}); });