jbilcke-hf HF staff commited on
Commit
851546d
1 Parent(s): f62b8d3

fixing bugs

Browse files
README.md CHANGED
@@ -1,7 +1,7 @@
1
  ---
2
  title: AI Tube
3
  emoji: 🍿
4
- colorFrom: red
5
  colorTo: red
6
  sdk: docker
7
  pinned: true
 
1
  ---
2
  title: AI Tube
3
  emoji: 🍿
4
+ colorFrom: yellow
5
  colorTo: red
6
  sdk: docker
7
  pinned: true
src/app/server/actions/ai-tube-hf/uploadVideoRequestToDataset.ts CHANGED
@@ -96,7 +96,7 @@ ${prompt}
96
  id: videoId,
97
  status: "submitted",
98
  label: title,
99
- description,,
100
  prompt,
101
  thumbnailUrl: "", // will be generated in async
102
  assetUrl: "", // will be generated in async
 
96
  id: videoId,
97
  status: "submitted",
98
  label: title,
99
+ description,
100
  prompt,
101
  thumbnailUrl: "", // will be generated in async
102
  assetUrl: "", // will be generated in async
src/app/views/home-view/index.tsx CHANGED
@@ -9,8 +9,8 @@ export function HomeView() {
9
  const setDisplayMode = useStore(s => s.setDisplayMode)
10
  const currentChannel = useStore(s => s.currentChannel)
11
  const setCurrentChannel = useStore(s => s.setCurrentChannel)
12
- const currentCategory = useStore(s => s.currentCategory)
13
- const setCurrentCategory = useStore(s => s.setCurrentCategory)
14
  const currentVideos = useStore(s => s.currentVideos)
15
  const setCurrentVideos = useStore(s => s.setCurrentVideos)
16
  const currentVideo = useStore(s => s.currentVideo)
@@ -20,28 +20,9 @@ export function HomeView() {
20
 
21
  // we use fake data for now
22
  // this will be pulled from the Hugging Face API
23
- const newCategoryVideos: VideoInfo[] = [
24
- {
25
- id: "42",
26
- label: "Test Julian",
27
- thumbnailUrl: "",
28
- assetUrl: "",
29
- numberOfViews: 0,
30
- createdAt: "2023-11-27",
31
- categories: [],
32
- channelId: "",
33
- channel: {
34
- id: "",
35
- slug: "",
36
- label: "Hugging Face",
37
- thumbnail: "",
38
- prompt: "",
39
- likes: 0,
40
- }
41
- }
42
- ]
43
  setCurrentVideos(newCategoryVideos)
44
- }, [currentCategory])
45
 
46
  return (
47
  <div className={cn(
 
9
  const setDisplayMode = useStore(s => s.setDisplayMode)
10
  const currentChannel = useStore(s => s.currentChannel)
11
  const setCurrentChannel = useStore(s => s.setCurrentChannel)
12
+ const currentTag = useStore(s => s.currentTag)
13
+ const setCurrentTag = useStore(s => s.setCurrentTag)
14
  const currentVideos = useStore(s => s.currentVideos)
15
  const setCurrentVideos = useStore(s => s.setCurrentVideos)
16
  const currentVideo = useStore(s => s.currentVideo)
 
20
 
21
  // we use fake data for now
22
  // this will be pulled from the Hugging Face API
23
+ const newCategoryVideos: VideoInfo[] = []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  setCurrentVideos(newCategoryVideos)
25
+ }, [currentTag])
26
 
27
  return (
28
  <div className={cn(
src/app/views/public-channel-view/index.tsx CHANGED
@@ -2,12 +2,8 @@ import { useEffect, useTransition } from "react"
2
 
3
  import { useStore } from "@/app/state/useStore"
4
  import { cn } from "@/lib/utils"
5
- import { VideoInfo } from "@/types"
6
  import { VideoList } from "@/app/interface/video-list"
7
- import { getChannelVideos } from "@/app/server/actions/api"
8
- import { useLocalStorage } from "usehooks-ts"
9
- import { localStorageKeys } from "@/app/state/locaStorageKeys"
10
- import { defaultSettings } from "@/app/state/defaultSettings"
11
 
12
  export function PublicChannelView() {
13
  const [_isPending, startTransition] = useTransition()
@@ -22,10 +18,12 @@ export function PublicChannelView() {
22
  }
23
 
24
  startTransition(async () => {
 
25
  const videos = await getChannelVideos({
26
  channel: currentChannel,
27
  })
28
  console.log("videos:", videos)
 
29
  })
30
 
31
  setCurrentVideos([])
 
2
 
3
  import { useStore } from "@/app/state/useStore"
4
  import { cn } from "@/lib/utils"
 
5
  import { VideoList } from "@/app/interface/video-list"
6
+
 
 
 
7
 
8
  export function PublicChannelView() {
9
  const [_isPending, startTransition] = useTransition()
 
18
  }
19
 
20
  startTransition(async () => {
21
+ /*
22
  const videos = await getChannelVideos({
23
  channel: currentChannel,
24
  })
25
  console.log("videos:", videos)
26
+ */
27
  })
28
 
29
  setCurrentVideos([])
src/app/views/public-channels-view/index.tsx CHANGED
@@ -2,7 +2,7 @@ import { useEffect, useState, useTransition } from "react"
2
 
3
  import { useStore } from "@/app/state/useStore"
4
  import { cn } from "@/lib/utils"
5
- import { getChannels } from "@/app/server/actions/api"
6
  import { ChannelList } from "@/app/interface/channel-list"
7
 
8
  export function PublicChannelsView() {
 
2
 
3
  import { useStore } from "@/app/state/useStore"
4
  import { cn } from "@/lib/utils"
5
+ import { getChannels } from "@/app/server/actions/ai-tube-hf/getChannels"
6
  import { ChannelList } from "@/app/interface/channel-list"
7
 
8
  export function PublicChannelsView() {
src/app/views/public-video-view/index.tsx CHANGED
@@ -16,7 +16,7 @@ export function PublicVideoView() {
16
 
17
  useEffect(() => {
18
 
19
- }, [currentCategory])
20
 
21
  return (
22
  <div className={cn(
 
16
 
17
  useEffect(() => {
18
 
19
+ }, [currentTag])
20
 
21
  return (
22
  <div className={cn(
src/app/views/user-channel-view/index.tsx CHANGED
@@ -4,13 +4,14 @@ import { useStore } from "@/app/state/useStore"
4
  import { cn } from "@/lib/utils"
5
  import { VideoInfo } from "@/types"
6
  import { VideoList } from "@/app/interface/video-list"
7
- import { submitVideoRequest, getChannelVideos } from "@/app/server/actions/api"
8
  import { useLocalStorage } from "usehooks-ts"
9
  import { localStorageKeys } from "@/app/state/locaStorageKeys"
10
  import { defaultSettings } from "@/app/state/defaultSettings"
11
  import { Input } from "@/components/ui/input"
12
  import { Textarea } from "@/components/ui/textarea"
13
  import { Button } from "@/components/ui/button"
 
14
 
15
  export function UserChannelView() {
16
  const [_isPending, startTransition] = useTransition()
@@ -34,11 +35,13 @@ export function UserChannelView() {
34
  }
35
 
36
  startTransition(async () => {
 
37
  const videos = await getChannelVideos({
38
  channel: currentChannel,
39
  apiKey: huggingfaceApiKey,
40
  })
41
  console.log("videos:", videos)
 
42
  })
43
 
44
  setCurrentVideos([])
@@ -61,7 +64,9 @@ export function UserChannelView() {
61
  channel: currentChannel,
62
  apiKey: huggingfaceApiKey,
63
  title: titleDraft,
64
- prompt: promptDraft
 
 
65
  })
66
 
67
  // in case of success we update the frontend immediately
@@ -71,11 +76,13 @@ export function UserChannelView() {
71
  setTitleDraft("")
72
 
73
  // also renew the cache on Next's side
 
74
  await getChannelVideos({
75
  channel: currentChannel,
76
  apiKey: huggingfaceApiKey,
77
  renewCache: true,
78
  })
 
79
  } catch (err) {
80
  console.error(err)
81
  } finally {
 
4
  import { cn } from "@/lib/utils"
5
  import { VideoInfo } from "@/types"
6
  import { VideoList } from "@/app/interface/video-list"
7
+
8
  import { useLocalStorage } from "usehooks-ts"
9
  import { localStorageKeys } from "@/app/state/locaStorageKeys"
10
  import { defaultSettings } from "@/app/state/defaultSettings"
11
  import { Input } from "@/components/ui/input"
12
  import { Textarea } from "@/components/ui/textarea"
13
  import { Button } from "@/components/ui/button"
14
+ import { submitVideoRequest } from "@/app/server/actions/submitVideoRequest"
15
 
16
  export function UserChannelView() {
17
  const [_isPending, startTransition] = useTransition()
 
35
  }
36
 
37
  startTransition(async () => {
38
+ /*
39
  const videos = await getChannelVideos({
40
  channel: currentChannel,
41
  apiKey: huggingfaceApiKey,
42
  })
43
  console.log("videos:", videos)
44
+ */
45
  })
46
 
47
  setCurrentVideos([])
 
64
  channel: currentChannel,
65
  apiKey: huggingfaceApiKey,
66
  title: titleDraft,
67
+ description: "",
68
+ prompt: promptDraft,
69
+ tags: [],
70
  })
71
 
72
  // in case of success we update the frontend immediately
 
76
  setTitleDraft("")
77
 
78
  // also renew the cache on Next's side
79
+ /*
80
  await getChannelVideos({
81
  channel: currentChannel,
82
  apiKey: huggingfaceApiKey,
83
  renewCache: true,
84
  })
85
+ */
86
  } catch (err) {
87
  console.error(err)
88
  } finally {