Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add spotify urls to all episodes #1667

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ model Show {
date DateTime
url String
youtube_url String?
spotify_url String?
show_notes String @db.Text
hash String @unique
slug String
Expand Down
1 change: 1 addition & 0 deletions shows/763 - Web Scraping.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ number: 763
title: Web Scraping + Reverse Engineering APIs
date: 1714561200000
url: https://traffic.libsyn.com/syntax/Syntax_-_763.mp3
spotify_url: https://open.spotify.com/episode/6QuwVPSE0iSORqDnx4VSVN
youtube_url: https://www.youtube.com/watch?v=5xWZT0MWz-4
---

Expand Down
2 changes: 1 addition & 1 deletion src/lib/ListenLinks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
target="_blank"
title="Watch or Listen on Spotify"
aria-label="Spotify"
href="https://open.spotify.com/search/syntax.fm {encodeURI(show.title)}/episodes"
href={show.spotify_url ? show.spotify_url : `https://open.spotify.com/search/syntax.fm%20${encodeURIComponent(show.title)}/episodes`}
>
<Icon name="spotify" />
</a>
Expand Down
7 changes: 5 additions & 2 deletions src/server/shows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ interface FrontMatterGuest {
twitter: string;
url: string;
youtube_url?: string;
spotify_url?: string;
social: string[];
}

Expand Down Expand Up @@ -54,7 +55,7 @@ export async function import_or_update_all_changed_shows() {

// If show doesn't exist or the hash has changed. Refresh
if (!existing_show || existing_show.hash !== hash) {
console.log(`Refreshing Show # ${number}`);
console.log(`Refreshing Show # ${number}`);
await parse_and_save_show_notes(md_file_contents, hash, number, md_file_path);
}
}
Expand Down Expand Up @@ -99,8 +100,9 @@ export async function parse_and_save_show_notes(
slug: slug(data.title),
date,
number,
url: data.url,
url: data.url,
youtube_url: data.youtube_url,
spotify_url: data.spotify_url,
show_notes: content,
hash: hash,
md_file,
Expand All @@ -114,6 +116,7 @@ export async function parse_and_save_show_notes(
date,
url: data.url,
youtube_url: data.youtube_url,
spotify_url: data.spotify_url,
show_notes: content,
hash: hash,
md_file,
Expand Down
Loading