Skip to content

Commit

Permalink
Removed Spotify from dev branch to a separate branch
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lvax committed Oct 25, 2024
1 parent 26f5d43 commit f194ab2
Show file tree
Hide file tree
Showing 15 changed files with 4 additions and 367 deletions.
13 changes: 0 additions & 13 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ model User {
Link Link[]
Skill Skill[]
Hobby Hobby[]
spotifyToken SpotifyToken?
Social Social[]
}

Expand Down Expand Up @@ -58,18 +57,6 @@ model Hobby {
postedBy User @relation(fields: [userId], references: [githubId])
}

// prisma/schema.prisma
model SpotifyToken {
id Int @id @default(autoincrement())
usedBy User @relation(fields: [userId], references: [githubId])
userId Int @unique
accessToken String
refreshToken String
expiresAt DateTime
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model Social {
id Int @id @default(autoincrement())
userId Int
Expand Down
13 changes: 1 addition & 12 deletions src/lib/components/MyProfile/UserSettings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Button } from '$lib/components/ui/button';
import { copyToClipboard } from '$lib/utils/copyToClipboard';
import { confirmDelete } from '$lib/utils/confirmDelete';
import { ArrowUpRight, Trash2, CircleChevronDown, Github, Copy, AudioLines } from 'lucide-svelte';
import { ArrowUpRight, Trash2, CircleChevronDown, Github, Copy } from 'lucide-svelte';
import { enhance } from '$app/forms';
import type { PageData } from '../../../routes/profile/$types';
Expand All @@ -13,17 +13,6 @@

<div class="flex w-full justify-end space-x-2">
<div class="flex flex-row space-x-2">
{#if data.spotifyToken}
<form action="?/unlinkSpotify" method="POST" use:enhance>
<Button variant="destructive" type="submit"
><AudioLines class="mr-2" /> Unlink Spotify</Button
>
</form>
{:else}
<Button href="/api/spotify/login"
><AudioLines class="mr-2 text-green-700" /> Link Spotify</Button
>
{/if}
<form action="?/updateOpenToCollaborating" method="POST" use:enhance>
{#if data.userData.openToCollaborating}
<Button variant="destructive" type="submit"
Expand Down
4 changes: 1 addition & 3 deletions src/lib/components/PublicProfile/ProfileFooter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
</script>

<p class="text-sm text-muted-foreground">
Ready to showcase your skills ? <a href="/" class="text-blue-600 underline"
>Create your profile now.</a
>
Ready to showcase ? <a href="/" class="text-blue-600 underline">Create your profile now.</a>
</p>
<LightDarkMode />
2 changes: 0 additions & 2 deletions src/lib/components/PublicProfile/UserInfo.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import type { GithubData } from '$lib/types/GithubData';
import type { PublicProfile } from '$lib/types/PublicProfile';
import MusicPlayer from '$lib/components/Shared/MusicPlayer.svelte';
import Hobbies from '$lib/components/PublicProfile/Hobbies.svelte';
import Socials from '$lib/components/PublicProfile/Socials.svelte';
import type { Social } from '@prisma/client';
Expand Down Expand Up @@ -82,7 +81,6 @@
<Hobbies {userData} />
</div>
</div>
<MusicPlayer githubUsername={userData.username} />
</div>
</div></Card.Content
>
Expand Down
83 changes: 0 additions & 83 deletions src/lib/components/Shared/MusicPlayer.svelte

This file was deleted.

14 changes: 0 additions & 14 deletions src/lib/types/Spotify.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/lib/utils/deleteUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ export const deleteUser = async (githubId: number, userId: number) => {
where: { userId: githubId }
});

//delete all the spotify tokens
await prisma.spotifyToken.deleteMany({
where: { userId: githubId }
});

//delete all the socials tokens
await prisma.social.deleteMany({
where: { userId: githubId }
Expand Down
18 changes: 0 additions & 18 deletions src/lib/utils/spotify/fetchSpotifyCurrentlyPlaying.ts

This file was deleted.

7 changes: 0 additions & 7 deletions src/lib/utils/spotify/generateRandomString.ts

This file was deleted.

23 changes: 0 additions & 23 deletions src/lib/utils/spotify/refreshSpotifyToken.ts

This file was deleted.

22 changes: 0 additions & 22 deletions src/lib/utils/spotify/unlinkSpotify.ts

This file was deleted.

72 changes: 0 additions & 72 deletions src/routes/api/spotify/callback/+server.ts

This file was deleted.

This file was deleted.

Loading

0 comments on commit f194ab2

Please sign in to comment.