feat: add music to front page of instance (#6)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class AddMusicFieldsToMeta1743894419864 implements MigrationInterface {
|
||||
name = 'AddMusicFieldsToMeta1743894419864'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "musicSource" character varying(1024)`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" ADD "musicEnabled" boolean NOT NULL DEFAULT false`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "musicEnabled"`);
|
||||
await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "musicSource"`);
|
||||
}
|
||||
}
|
||||
@@ -114,6 +114,8 @@ export class MetaEntityService {
|
||||
sidebarLogoUrl: instance.sidebarLogoUrl,
|
||||
backgroundImageUrl: instance.backgroundImageUrl,
|
||||
logoImageUrl: instance.logoImageUrl,
|
||||
musicSource: instance.musicSource,
|
||||
musicEnabled: instance.musicEnabled,
|
||||
maxNoteTextLength: this.config.maxNoteLength,
|
||||
maxRemoteNoteTextLength: this.config.maxRemoteNoteLength,
|
||||
maxCwLength: this.config.maxCwLength,
|
||||
|
||||
@@ -142,6 +142,17 @@ export class MiMeta {
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
})
|
||||
public musicSource: string | null;
|
||||
|
||||
@Column('boolean', {
|
||||
default: false,
|
||||
})
|
||||
public musicEnabled: boolean;
|
||||
|
||||
@Column('varchar', {
|
||||
length: 1024,
|
||||
nullable: true,
|
||||
})
|
||||
public iconUrl: string | null;
|
||||
|
||||
@Column('varchar', {
|
||||
|
||||
@@ -321,6 +321,14 @@ export const packedMetaLiteSchema = {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
musicSource: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
musicEnabled: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
privacyPolicyUrl: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
|
||||
@@ -453,6 +453,14 @@ export const meta = {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
musicSource: {
|
||||
type: 'string',
|
||||
optional: false, nullable: true,
|
||||
},
|
||||
musicEnabled: {
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
translationTimeout: {
|
||||
type: 'number',
|
||||
optional: false, nullable: false,
|
||||
@@ -696,6 +704,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
app512IconUrl: instance.app512IconUrl,
|
||||
sidebarLogoUrl: instance.sidebarLogoUrl,
|
||||
backgroundImageUrl: instance.backgroundImageUrl,
|
||||
musicSource: instance.musicSource,
|
||||
musicEnabled: instance.musicEnabled,
|
||||
logoImageUrl: instance.logoImageUrl,
|
||||
defaultLightTheme: instance.defaultLightTheme,
|
||||
defaultDarkTheme: instance.defaultDarkTheme,
|
||||
|
||||
@@ -63,6 +63,8 @@ export const paramDef = {
|
||||
app512IconUrl: { type: 'string', nullable: true },
|
||||
sidebarLogoUrl: { type: 'string', nullable: true },
|
||||
backgroundImageUrl: { type: 'string', nullable: true },
|
||||
musicSource: { type: 'string', nullable: true },
|
||||
musicEnabled: { type: 'boolean', nullable: false },
|
||||
logoImageUrl: { type: 'string', nullable: true },
|
||||
name: { type: 'string', nullable: true },
|
||||
shortName: { type: 'string', nullable: true },
|
||||
@@ -316,6 +318,14 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||
set.backgroundImageUrl = ps.backgroundImageUrl;
|
||||
}
|
||||
|
||||
if (ps.musicEnabled !== undefined) {
|
||||
set.musicEnabled = ps.musicEnabled;
|
||||
}
|
||||
|
||||
if (ps.musicSource !== undefined) {
|
||||
set.musicSource = ps.musicSource;
|
||||
}
|
||||
|
||||
if (ps.logoImageUrl !== undefined) {
|
||||
set.logoImageUrl = ps.logoImageUrl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user