refactor: prefix Mi for all entities (#11719)

* wip

* wip

* wip

* wip

* Update RepositoryModule.ts

* wip

* wip

* wip

* Revert "wip"

This reverts commit c1c13b37d2aaf3c65bc148212da302b0eb7868bf.
This commit is contained in:
syuilo 2023-08-16 17:51:28 +09:00 committed by GitHub
parent 9264ca336b
commit 792622aead
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
229 changed files with 1990 additions and 1990 deletions

View file

@ -8,7 +8,7 @@ import { Inject, Injectable } from '@nestjs/common';
import { JSDOM } from 'jsdom';
import tinycolor from 'tinycolor2';
import * as Redis from 'ioredis';
import type { Instance } from '@/models/entities/Instance.js';
import type { MiInstance } from '@/models/entities/Instance.js';
import type Logger from '@/logger.js';
import { DI } from '@/di-symbols.js';
import { LoggerService } from '@/core/LoggerService.js';
@ -62,7 +62,7 @@ export class FetchInstanceMetadataService {
}
@bindThis
public async fetchInstanceMetadata(instance: Instance, force = false): Promise<void> {
public async fetchInstanceMetadata(instance: MiInstance, force = false): Promise<void> {
const host = instance.host;
// Acquire mutex to ensure no parallel runs
if (!await this.tryLock(host)) return;
@ -123,7 +123,7 @@ export class FetchInstanceMetadataService {
}
@bindThis
private async fetchNodeinfo(instance: Instance): Promise<NodeInfo> {
private async fetchNodeinfo(instance: MiInstance): Promise<NodeInfo> {
this.logger.info(`Fetching nodeinfo of ${instance.host} ...`);
try {
@ -167,7 +167,7 @@ export class FetchInstanceMetadataService {
}
@bindThis
private async fetchDom(instance: Instance): Promise<DOMWindow['document']> {
private async fetchDom(instance: MiInstance): Promise<DOMWindow['document']> {
this.logger.info(`Fetching HTML of ${instance.host} ...`);
const url = 'https://' + instance.host;
@ -181,7 +181,7 @@ export class FetchInstanceMetadataService {
}
@bindThis
private async fetchManifest(instance: Instance): Promise<Record<string, unknown> | null> {
private async fetchManifest(instance: MiInstance): Promise<Record<string, unknown> | null> {
const url = 'https://' + instance.host;
const manifestUrl = url + '/manifest.json';
@ -192,7 +192,7 @@ export class FetchInstanceMetadataService {
}
@bindThis
private async fetchFaviconUrl(instance: Instance, doc: DOMWindow['document'] | null): Promise<string | null> {
private async fetchFaviconUrl(instance: MiInstance, doc: DOMWindow['document'] | null): Promise<string | null> {
const url = 'https://' + instance.host;
if (doc) {
@ -218,7 +218,7 @@ export class FetchInstanceMetadataService {
}
@bindThis
private async fetchIconUrl(instance: Instance, doc: DOMWindow['document'] | null, manifest: Record<string, any> | null): Promise<string | null> {
private async fetchIconUrl(instance: MiInstance, doc: DOMWindow['document'] | null, manifest: Record<string, any> | null): Promise<string | null> {
if (manifest && manifest.icons && manifest.icons.length > 0 && manifest.icons[0].src) {
const url = 'https://' + instance.host;
return (new URL(manifest.icons[0].src, url)).href;