Skip to content

Commit

Permalink
deploy via script
Browse files Browse the repository at this point in the history
  • Loading branch information
kaangiray26 committed Jun 29, 2023
1 parent 8996b4b commit b062812
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/min/spotify-new-releases.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/min/spotify.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions extractors/spotify-new-releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const extractor = () => {

async function get_posts(page = 1, request = null, args = null) {
let credentials = await auth();
if (!credentials) return [];

return await request.get({
url: `https://api.spotify.com/v1/browse/new-releases?limit=12&offset=${(page - 1) * 12}`,
Expand All @@ -38,10 +39,7 @@ const extractor = () => {
image: item.images[0].url,
page: "/discover/spotify/" + item.type + "s/" + item.id,
})))
.catch(err => {
console.log(err);
return [];
});
.catch(err => []);
}

async function get_post() {
Expand Down
5 changes: 5 additions & 0 deletions extractors/spotify.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const extractor = () => {

async function get_post(id, request = null, args = null) {
let credentials = await auth();
if (!credentials) return null;

if (id.startsWith("albums")) {
return await request.get({
Expand All @@ -43,6 +44,7 @@ const extractor = () => {
image: item.images[0].url,
page: "/discover/spotify/" + item.type + "s/" + item.id,
}))
.catch(err => null);
}

if (id.startsWith("artists")) {
Expand All @@ -62,6 +64,7 @@ const extractor = () => {
image: item.images[0].url,
page: "/discover/spotify/" + item.type + "s/" + item.id,
}))
.catch(err => null);
}

if (id.startsWith("playlists")) {
Expand All @@ -81,6 +84,7 @@ const extractor = () => {
image: item.images[0].url,
page: "/discover/spotify/" + item.type + "s/" + item.id,
}))
.catch(err => null);
}

if (id.startsWith("tracks")) {
Expand All @@ -100,6 +104,7 @@ const extractor = () => {
image: item.images[0].url,
page: "/discover/spotify/" + item.type + "s/" + item.id,
}))
.catch(err => null);
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/components/SingleShortPost.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<div class="d-flex square p-1 me-1">
<img ref="target" class="cover icon" :src="obj.image" @error="placeholder" loading="lazy">
</div>
<div class="d-flex flex-fill align-items-center">
<div class="d-flex flex-column align-items-start">
<small class="text-muted">{{ obj.author }}</small>
<h6 class="text-break p-1 m-0">{{ obj.title }}</h6>
</div>
</div>
Expand Down

0 comments on commit b062812

Please sign in to comment.