mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 19:14:16 +00:00
use thumbnails as fallback
This commit is contained in:
parent
5c4d3ddd84
commit
6eb69a8ef8
@ -50,7 +50,7 @@ export default (props) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="music-track_cover">
|
<div className="music-track_cover">
|
||||||
<ImageViewer src={props.track.thumbnail} />
|
<ImageViewer src={props.track.cover ?? props.track.thumbnail} />
|
||||||
</div>
|
</div>
|
||||||
<div className="music-track_details">
|
<div className="music-track_details">
|
||||||
<div className="music-track_title">
|
<div className="music-track_title">
|
||||||
|
@ -129,7 +129,7 @@ export class AudioPlayer extends React.Component {
|
|||||||
<div
|
<div
|
||||||
className="cover"
|
className="cover"
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(${(this.context.currentManifest?.thumbnail) ?? "/assets/no_song.png"})`,
|
backgroundImage: `url(${(this.context.currentManifest?.cover ?? this.context.currentManifest?.thumbnail) ?? "/assets/no_song.png"})`,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div className="header">
|
<div className="header">
|
||||||
|
@ -236,8 +236,8 @@ export default class Player extends Core {
|
|||||||
if (change.object.currentAudioManifest) {
|
if (change.object.currentAudioManifest) {
|
||||||
// analyze cover color
|
// analyze cover color
|
||||||
|
|
||||||
if (change.object.currentAudioManifest.thumbnail) {
|
if (change.object.currentAudioManifest.cover || change.object.currentAudioManifest.thumbnail) {
|
||||||
this.fac.getColorAsync(change.object.currentAudioManifest.thumbnail)
|
this.fac.getColorAsync(change.object.currentAudioManifest.cover ?? change.object.currentAudioManifest.thumbnail)
|
||||||
.then((color) => {
|
.then((color) => {
|
||||||
this.state.coverColorAnalysis = color
|
this.state.coverColorAnalysis = color
|
||||||
})
|
})
|
||||||
|
@ -173,7 +173,7 @@ const PlaylistItem = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ImageViewer
|
<ImageViewer
|
||||||
src={playlist.thumbnail ?? "/assets/no_song.png"}
|
src={playlist.cover ?? playlist.thumbnail ?? "/assets/no_song.png"}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ import UploadButton from "components/UploadButton"
|
|||||||
export default (props) => {
|
export default (props) => {
|
||||||
const [playlistName, setPlaylistName] = React.useState(props.playlist.title)
|
const [playlistName, setPlaylistName] = React.useState(props.playlist.title)
|
||||||
const [playlistDescription, setPlaylistDescription] = React.useState(props.playlist.description)
|
const [playlistDescription, setPlaylistDescription] = React.useState(props.playlist.description)
|
||||||
const [playlistThumbnail, setPlaylistThumbnail] = React.useState(props.playlist.thumbnail)
|
const [playlistThumbnail, setPlaylistThumbnail] = React.useState(props.playlist.cover ?? props.playlist.thumbnail)
|
||||||
const [playlistVisibility, setPlaylistVisibility] = React.useState(props.playlist.visibility)
|
const [playlistVisibility, setPlaylistVisibility] = React.useState(props.playlist.visibility)
|
||||||
|
|
||||||
const handleTitleOnChange = (event) => {
|
const handleTitleOnChange = (event) => {
|
||||||
|
@ -63,7 +63,7 @@ export default (props) => {
|
|||||||
<div className="play_info_wrapper">
|
<div className="play_info_wrapper">
|
||||||
<div className="play_info">
|
<div className="play_info">
|
||||||
<div className="play_info_cover">
|
<div className="play_info_cover">
|
||||||
<ImageViewer src={playlist?.thumbnail ?? "/assets/no_song.png"} />
|
<ImageViewer src={playlist.cover ?? playlist?.thumbnail ?? "/assets/no_song.png"} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="play_info_details">
|
<div className="play_info_details">
|
||||||
|
@ -18,6 +18,10 @@ export default {
|
|||||||
default: [],
|
default: [],
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
|
cover: {
|
||||||
|
type: String,
|
||||||
|
default: "https://storage.ragestudio.net/comty-static-assets/default_song.png"
|
||||||
|
},
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "https://storage.ragestudio.net/comty-static-assets/default_song.png"
|
default: "https://storage.ragestudio.net/comty-static-assets/default_song.png"
|
||||||
|
@ -27,6 +27,10 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
cover: {
|
||||||
|
type: String,
|
||||||
|
default: "https://storage.ragestudio.net/comty-static-assets/default_song.png"
|
||||||
|
},
|
||||||
thumbnail: {
|
thumbnail: {
|
||||||
type: String,
|
type: String,
|
||||||
default: "https://storage.ragestudio.net/comty-static-assets/default_song.png"
|
default: "https://storage.ragestudio.net/comty-static-assets/default_song.png"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user