mirror of
https://github.com/lqtmcstudio/QZMusic_PC.git
synced 2026-08-19 02:23:23 +08:00
feat: 低音增强、音频输出设备、社交功能与设置页全面升级
- 新增低音增强功能: 支持普通/高级模式,预设扬声器/耳机两种方案,可调分频点/增益/激励器/湿声比例等参数 - 新增音频输出设备选择: 支持 WASAPI 独占模式、设备列表枚举与格式匹配 - 播放时后台保活: 使用 powerSaveBlocker 阻止系统休眠/息屏导致音频中断 - 隐私设置扩展: 新增「允许他人查看关注列表」选项 - 社交功能: 用户关注/取关、粉丝/关注列表查看、用户关系页 (UserConnections) - 歌单喜欢: 云歌单支持点赞/取消喜欢,显示喜欢数 - 最近播放: 自动记录用户最近播放歌曲并上报 - 一起听优化: 修复心跳计时器休眠挂起导致 Illegal heartbeat 的问题,改进远端状态同步逻辑 - 设置页 UI 大幅扩展: 音质设置、低音增强可视化控制、音频输出配置 - 新增 FFmpeg 许可证文件 - 用户主页增强: 听歌排行、听歌统计、最近播放等视图优化
This commit is contained in:
@@ -362,14 +362,14 @@ export async function updateCurrentUserProfile(payload: Partial<UserInfo>): Prom
|
||||
return userInfo
|
||||
}
|
||||
|
||||
export async function getLibraryPrivacy(): Promise<{ status: string; allow_public_library: boolean; allow_public_profile: boolean }> {
|
||||
export async function getLibraryPrivacy(): Promise<{ status: string; allow_public_library: boolean; allow_public_profile: boolean; allow_public_following: boolean }> {
|
||||
const state = loadAuthState()
|
||||
const userId = state.userInfo?.id
|
||||
if (!userId) throw new Error('Not logged in')
|
||||
return qzFetch(`/user/${encodeURIComponent(userId)}/privacy/library`)
|
||||
}
|
||||
|
||||
export async function setLibraryPrivacy(payload: { allow_public_library?: boolean; allow_public_profile?: boolean }): Promise<{ status: string; allow_public_library: boolean; allow_public_profile: boolean }> {
|
||||
export async function setLibraryPrivacy(payload: { allow_public_library?: boolean; allow_public_profile?: boolean; allow_public_following?: boolean }): Promise<{ status: string; allow_public_library: boolean; allow_public_profile: boolean; allow_public_following: boolean }> {
|
||||
const state = loadAuthState()
|
||||
const userId = state.userInfo?.id
|
||||
if (!userId) throw new Error('Not logged in')
|
||||
@@ -378,3 +378,43 @@ export async function setLibraryPrivacy(payload: { allow_public_library?: boolea
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
}
|
||||
|
||||
// === Recent Plays ===
|
||||
|
||||
export async function getRecentSongs(userId: string): Promise<any[]> {
|
||||
if (!userId) throw new Error('Missing user id')
|
||||
const result = await qzFetch(`/user/${encodeURIComponent(userId)}/recent/songs`)
|
||||
return Array.isArray(result) ? result : []
|
||||
}
|
||||
|
||||
export async function addRecentSong(userId: string, song: any): Promise<any> {
|
||||
if (!userId) throw new Error('Missing user id')
|
||||
return qzFetch(`/user/${encodeURIComponent(userId)}/recent/songs`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(song),
|
||||
})
|
||||
}
|
||||
|
||||
// === Playlist Likes ===
|
||||
|
||||
export async function togglePlaylistLike(playlistId: string): Promise<{ status: string; liked: boolean; like_count: number }> {
|
||||
return qzFetch(`/playlist/${encodeURIComponent(playlistId)}/like`, {
|
||||
method: 'POST',
|
||||
})
|
||||
}
|
||||
|
||||
export async function getPlaylistLike(playlistId: string): Promise<{ status: string; liked: boolean; like_count: number }> {
|
||||
return qzFetch(`/playlist/${encodeURIComponent(playlistId)}/like`)
|
||||
}
|
||||
|
||||
// === User Follow ===
|
||||
|
||||
export async function toggleUserFollow(targetUserId: string): Promise<{ status: string; subscribing: boolean }> {
|
||||
return qzFetch(`/user/${encodeURIComponent(targetUserId)}/subscribes`, {
|
||||
method: 'PATCH',
|
||||
})
|
||||
}
|
||||
|
||||
export async function getUserSubscriptions(targetUserId: string): Promise<{ status: string; fans: number; subs: number; fans_list?: string[]; subs_list?: string[]; can_view_subs?: boolean }> {
|
||||
return qzFetch(`/user/${encodeURIComponent(targetUserId)}/subscribes`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user