Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
wip newdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
greg6775 committed Nov 25, 2024
1 parent efc152e commit b1b12f2
Show file tree
Hide file tree
Showing 6 changed files with 234 additions and 229 deletions.
4 changes: 2 additions & 2 deletions pages/music/data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { delay } from "@std/async";
import { API, StreamingUploadHandler, stupidErrorAlert } from "shared/mod.ts";
import { Reference } from "webgen/mod.ts";
import { Reference, WriteSignal } from "webgen/mod.ts";
import { ArtistRef, Song } from "../../spec/music.ts";

export function uploadSongToDrop(songs: Reference<Song[]>, artists: ArtistRef[], language: string, primaryGenre: string, secondaryGenre: string, uploadingSongs: Reference<{ [key: string]: number }[]>, file: File) {
Expand Down Expand Up @@ -63,7 +63,7 @@ export function uploadSongToDrop(songs: Reference<Song[]>, artists: ArtistRef[],
}, file);
}

export function uploadArtwork(id: string, file: File, artworkClientData: Reference<AdvancedImage | undefined>, artwork: Reference<string | undefined>) {
export function uploadArtwork(id: string, file: File, artworkClientData: WriteSignal<string | undefined>, artwork: WriteSignal<string | undefined>) {
const blobUrl = URL.createObjectURL(file);
artworkClientData.setValue({ type: "uploading", filename: file.name, blobUrl, percentage: 0 });

Expand Down
7 changes: 1 addition & 6 deletions pages/music/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import "./pages/payouts.ts";
import "./pages/publishedDrops.ts";
import "./pages/unpublishedDrops.ts";

/// <reference types="npm:@types/dom-navigation/index.d.ts" />

import { RegisterAuthRefresh, sheetStack } from "shared/helper.ts";
import { Navigation } from "shared/navigation.ts";
import { API, stupidErrorAlert } from "shared/restSpec.ts";
Expand Down Expand Up @@ -51,10 +49,7 @@ appendBody(
.map((isArtistsRoute) =>
isArtistsRoute
? PrimaryButton("Create new Artist")
.onClick(() => {
sheetStack.addSheet(createArtistSheet());
// createArtistSheet().then(async () => menuState.artists = await API.music.artists.list().then(stupidErrorAlert));
})
.onClick(() => sheetStack.addSheet(createArtistSheet()))
: PrimaryButton("Create new Drop")
.onPromiseClick(async () => {
const { id } = await API.music.drops.create().then(stupidErrorAlert);
Expand Down
Loading

0 comments on commit b1b12f2

Please sign in to comment.