Skip to content

Commit

Permalink
DEBUG: trying splitting the cases
Browse files Browse the repository at this point in the history
  • Loading branch information
koustov committed Jul 31, 2022
1 parent ebb1760 commit 3c3e0a3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/common/playlists/PlayMeta.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,16 @@ function PlayMeta() {
if (play_obj.cover) {
// If cover image path is updated in DB
metaImagePath = play_obj.cover; // If cover path is given, use that
} else if (play.path) {
const pathSegment =play.path.split("/");
} else if (play_obj.path) {
const pathSegment =play_obj.path.split("/");
if(pathSegment.length > 2) {
const playFolder = pathSegment[2];
metaImagePath = `https://react-play-git-issue-417-play-url-update-atapas.vercel.app/${require(`../../plays/${username}/${playFolder}/cover.png`)}`;
try{
metaImagePath = `https://react-play-git-issue-417-play-url-update-atapas.vercel.app/${require(`plays/${username}/${playFolder}/cover.png`)}`;
}
catch(err){
console.log("Cover image couldn't be retrieved from play folder.", err);
}
}
} else {
try {
Expand Down

0 comments on commit 3c3e0a3

Please sign in to comment.