feat: updates

This commit is contained in:
qier222 2023-03-05 19:03:52 +08:00
parent 840a5b8e9b
commit cb0a809b16
No known key found for this signature in database
29 changed files with 1550 additions and 449 deletions

View file

@ -1,6 +1,5 @@
import { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify'
import NeteaseCloudMusicApi, { SoundQualityType } from 'NeteaseCloudMusicApi'
import prisma from '@/desktop/main/prisma'
import { app } from 'electron'
import log from '@/desktop/main/log'
import { appName } from '@/desktop/main/env'
@ -10,10 +9,11 @@ import youtube from '@/desktop/main/youtube'
import { CacheAPIs } from '@/shared/CacheAPIs'
import { FetchTracksResponse } from '@/shared/api/Track'
import store from '@/desktop/main/store'
import { db, Tables } from '@/desktop/main/db'
const getAudioFromCache = async (id: number) => {
// get from cache
const cache = await prisma.audio.findUnique({ where: { id } })
const cache = await db.find(Tables.Audio, id)
if (!cache) return
const audioFileName = `${cache.id}-${cache.bitRate}.${cache.format}`