mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
- Introduces a new Music Library system for managing favorites (tracks, playlists, releases), replacing the previous TrackLike model. - Completely revamps the Studio TV profile page, adding live statistics, stream configuration, restream management, and media URL display. - Enhances the media player with a custom seekbar and improved audio playback logic for MPD and non-MPD sources. - Lays foundational groundwork for chat encryption with new models and APIs. - Refactors critical UI components like PlaylistView and PagePanel. - Standardizes monorepo development scripts to use npm. - Updates comty.js submodule and adds various new UI components.
65 lines
1.3 KiB
JavaScript
65 lines
1.3 KiB
JavaScript
import React from "react"
|
|
import * as antd from "antd"
|
|
|
|
import ProfileCreator from "./components/ProfileCreator"
|
|
import Skeleton from "@components/Skeleton"
|
|
|
|
import Streaming from "@models/spectrum"
|
|
|
|
import useCenteredContainer from "@hooks/useCenteredContainer"
|
|
|
|
import "./index.less"
|
|
|
|
const Profile = ({ profile, onClick }) => {
|
|
return <div onClick={onClick}>{profile.profile_name}</div>
|
|
}
|
|
|
|
const TVStudioPage = (props) => {
|
|
useCenteredContainer(false)
|
|
|
|
const [loading, list, error, repeat] = app.cores.api.useRequest(
|
|
Streaming.getOwnProfiles,
|
|
)
|
|
|
|
function handleNewProfileClick() {
|
|
app.layout.modal.open("tv_profile_creator", ProfileCreator, {
|
|
props: {
|
|
onCreate: (id, data) => {
|
|
setSelectedProfileId(id)
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
function handleProfileClick(id) {
|
|
app.location.push(`/studio/tv/${id}`)
|
|
}
|
|
|
|
if (loading) {
|
|
return <Skeleton />
|
|
}
|
|
|
|
return (
|
|
<div className="tvstudio-page">
|
|
<div className="tvstudio-page-actions">
|
|
<antd.Button type="primary" onClick={handleNewProfileClick}>
|
|
Create new
|
|
</antd.Button>
|
|
</div>
|
|
|
|
{list.length > 0 &&
|
|
list.map((profile, index) => {
|
|
return (
|
|
<Profile
|
|
key={index}
|
|
profile={profile}
|
|
onClick={() => handleProfileClick(profile._id)}
|
|
/>
|
|
)
|
|
})}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default TVStudioPage
|