minor
This commit is contained in:
		
							parent
							
								
									6346344c51
								
							
						
					
					
						commit
						770ed88cfa
					
				@ -9,7 +9,7 @@ import { CharacterImage, SimpleCharacter } from '../interfaces';
 | 
				
			|||||||
import { Scoring } from './matcher-types';
 | 
					import { Scoring } from './matcher-types';
 | 
				
			||||||
import { matchesSmartFilters } from './filter/smart-filter';
 | 
					import { matchesSmartFilters } from './filter/smart-filter';
 | 
				
			||||||
import * as remote from '@electron/remote';
 | 
					import * as remote from '@electron/remote';
 | 
				
			||||||
 | 
					import log from 'electron-log'; //tslint:disable-line:match-default-export-name
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export interface MetaRecord {
 | 
					export interface MetaRecord {
 | 
				
			||||||
    images: CharacterImage[] | null;
 | 
					    images: CharacterImage[] | null;
 | 
				
			||||||
@ -83,10 +83,10 @@ export class ProfileCache extends AsyncCache<CharacterCacheRecord> {
 | 
				
			|||||||
            return null;
 | 
					            return null;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (false) {
 | 
					        // if (false) {
 | 
				
			||||||
            console.log(`Retrieve '${name}' for channel '${fromChannel}, gap: ${(Date.now() - this.lastFetch)}ms`);
 | 
					        //     log.info(`Retrieve '${name}' for channel '${fromChannel}, gap: ${(Date.now() - this.lastFetch)}ms`);
 | 
				
			||||||
            this.lastFetch = Date.now();
 | 
					        //     this.lastFetch = Date.now();
 | 
				
			||||||
        }
 | 
					        // }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const pd = await this.store.getProfile(name);
 | 
					        const pd = await this.store.getProfile(name);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -184,6 +184,7 @@ export class ProfileCache extends AsyncCache<CharacterCacheRecord> {
 | 
				
			|||||||
            const avatarUrl = match[1].trim();
 | 
					            const avatarUrl = match[1].trim();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (!this.isSafeImageURL(avatarUrl)) {
 | 
					            if (!this.isSafeImageURL(avatarUrl)) {
 | 
				
			||||||
 | 
					                log.info('portrait.hq.invalid.domain', { url: avatarUrl });
 | 
				
			||||||
                return;
 | 
					                return;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -193,6 +194,7 @@ export class ProfileCache extends AsyncCache<CharacterCacheRecord> {
 | 
				
			|||||||
                parent.send('update-avatar-url', c.character.name, avatarUrl);
 | 
					                parent.send('update-avatar-url', c.character.name, avatarUrl);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            log.info('portrait.hq.url', { url: avatarUrl });
 | 
				
			||||||
            core.characters.setOverride(c.character.name, 'avatarUrl', avatarUrl);
 | 
					            core.characters.setOverride(c.character.name, 'avatarUrl', avatarUrl);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -204,7 +206,7 @@ export class ProfileCache extends AsyncCache<CharacterCacheRecord> {
 | 
				
			|||||||
        let score = (!match || match.score === null) ? Scoring.NEUTRAL : match.score;
 | 
					        let score = (!match || match.score === null) ? Scoring.NEUTRAL : match.score;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (score === 0) {
 | 
					        if (score === 0) {
 | 
				
			||||||
            console.log(`Storing score 0 for character ${c.character.name}`);
 | 
					            log.info('cache.profile.store.zero.score', { name: c.character.name });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.updateOverrides(c);
 | 
					        this.updateOverrides(c);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user