Skip to content

Commit cb42dbd

Browse files
committed
support adfreemp3 key
1 parent 8164dad commit cb42dbd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/helpers/post.helper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getAdFreeMp3 } from '../helpers/mp3.helper';
55
import { getPrivateRss } from '../helpers/rss.helper';
66

77
function replaceWithAdFree(post, fullUser) {
8-
post.mp3 = getAdFreeMp3(post.mp3) // eslint-disable-line
8+
post.mp3 = post.adFreeMp3 || getAdFreeMp3(post.mp3) // eslint-disable-line
99
post.rss = getPrivateRss(fullUser) // eslint-disable-line
1010
}
1111

@@ -64,6 +64,8 @@ async function addPostData(post, fullUser) {
6464

6565
if (fullUser && fullUser.subscription && fullUser.subscription.active) {
6666
replaceWithAdFree(post, fullUser);
67+
} else {
68+
post.adFreeMp3 = null; // eslint-disable-line
6769
}
6870

6971
return post;

0 commit comments

Comments
 (0)