mirror of
https://github.com/mmahdium/TBW.git
synced 2026-08-14 16:22:48 +03:30
Fixed some naming problems
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<link rel="icon" href="/favicon.ico">
|
<link rel="icon" href="/favicon.ico">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="description" content="A simple and beautiful movie list app built with Vue 3 and Tailwind CSS (daisyUI).">
|
<meta name="description" content="A simple and beautiful media list app built with Vue 3 and Tailwind CSS (daisyUI).">
|
||||||
<title>To Be Watched</title>
|
<title>To Be Watched</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ function onSubmit() {
|
|||||||
<!-- Input -->
|
<!-- Input -->
|
||||||
<input
|
<input
|
||||||
type="search"
|
type="search"
|
||||||
placeholder="Search for a movie"
|
placeholder="Search for media"
|
||||||
required
|
required
|
||||||
:value="props.modelValue"
|
:value="props.modelValue"
|
||||||
@input="emit('update:modelValue', ($event.target as HTMLInputElement).value)"
|
@input="emit('update:modelValue', ($event.target as HTMLInputElement).value)"
|
||||||
|
|||||||
+10
-10
@@ -7,7 +7,7 @@ import type { MediaType } from '@/types/Media'
|
|||||||
import ErrorAlert from '@/components/alerts/ErrorAlert.vue'
|
import ErrorAlert from '@/components/alerts/ErrorAlert.vue'
|
||||||
import { useSearchPageStore } from '@/stores/media'
|
import { useSearchPageStore } from '@/stores/media'
|
||||||
|
|
||||||
const movies = ref<MediaType[]>()
|
const medias = ref<MediaType[]>()
|
||||||
const seachError = ref<string>('')
|
const seachError = ref<string>('')
|
||||||
const searchQuery = ref('')
|
const searchQuery = ref('')
|
||||||
const searchPage = ref(1)
|
const searchPage = ref(1)
|
||||||
@@ -23,16 +23,16 @@ async function searchMovie() {
|
|||||||
const result = await searchMovies(searchQuery.value)
|
const result = await searchMovies(searchQuery.value)
|
||||||
console.log(result)
|
console.log(result)
|
||||||
if (result.totalResults === 0) {
|
if (result.totalResults === 0) {
|
||||||
movies.value = []
|
medias.value = []
|
||||||
seachError.value = 'No results found'
|
seachError.value = 'No results found'
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
seachError.value = ''
|
seachError.value = ''
|
||||||
movies.value = result.Results
|
medias.value = result.Results
|
||||||
|
|
||||||
state.setState(searchPage.value, searchQuery.value, result.Results)
|
state.setState(searchPage.value, searchQuery.value, result.Results)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
movies.value = []
|
medias.value = []
|
||||||
console.error(error)
|
console.error(error)
|
||||||
seachError.value = (error as Error).message
|
seachError.value = (error as Error).message
|
||||||
} finally {
|
} finally {
|
||||||
@@ -45,8 +45,8 @@ async function loadMore() {
|
|||||||
isLoadingMore.value = true
|
isLoadingMore.value = true
|
||||||
searchPage.value++
|
searchPage.value++
|
||||||
const result = await loadMoreMovies(searchQuery.value, searchPage.value)
|
const result = await loadMoreMovies(searchQuery.value, searchPage.value)
|
||||||
movies.value?.push(...result.Results)
|
medias.value?.push(...result.Results)
|
||||||
state.setState(searchPage.value, searchQuery.value, movies.value ? movies.value : [])
|
state.setState(searchPage.value, searchQuery.value, medias.value ? medias.value : [])
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
searchPage.value = 1
|
searchPage.value = 1
|
||||||
seachError.value = (error as Error).message
|
seachError.value = (error as Error).message
|
||||||
@@ -64,7 +64,7 @@ onMounted(() => {
|
|||||||
) {
|
) {
|
||||||
searchQuery.value = state.searchQuery
|
searchQuery.value = state.searchQuery
|
||||||
searchPage.value = state.searchPage
|
searchPage.value = state.searchPage
|
||||||
movies.value = state.mediaList
|
medias.value = state.mediaList
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ watch(searchQuery, () => {
|
|||||||
<h1
|
<h1
|
||||||
class="text-4xl font-extrabold text-center mb-10 bg-linear-to-r from-gray-700 to-gray-500 bg-clip-text text-transparent"
|
class="text-4xl font-extrabold text-center mb-10 bg-linear-to-r from-gray-700 to-gray-500 bg-clip-text text-transparent"
|
||||||
>
|
>
|
||||||
Add a Movie
|
Add Media
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<!-- Search bar -->
|
<!-- Search bar -->
|
||||||
@@ -103,8 +103,8 @@ watch(searchQuery, () => {
|
|||||||
|
|
||||||
<!-- Movie list -->
|
<!-- Movie list -->
|
||||||
<MediaList
|
<MediaList
|
||||||
v-else-if="movies && movies.length > 0"
|
v-else-if="medias && medias.length > 0"
|
||||||
:medias="movies"
|
:medias="medias"
|
||||||
:loading-more="isLoadingMore"
|
:loading-more="isLoadingMore"
|
||||||
@loadMore="loadMore"
|
@loadMore="loadMore"
|
||||||
:is-search="true"
|
:is-search="true"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p class="text-lg text-gray-600 max-w-2xl mb-12">
|
<p class="text-lg text-gray-600 max-w-2xl mb-12">
|
||||||
A simple and beautiful movie list app built with Vue 3 and Tailwind CSS (daisyUI).
|
A simple and beautiful media list app built with Vue 3 and Tailwind CSS (daisyUI).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<RouterLink
|
<RouterLink
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const store = useMediaStore()
|
|||||||
<h1
|
<h1
|
||||||
class="text-4xl font-extrabold text-center mb-10 bg-linear-to-r from-gray-700 to-gray-500 bg-clip-text text-transparent"
|
class="text-4xl font-extrabold text-center mb-10 bg-linear-to-r from-gray-700 to-gray-500 bg-clip-text text-transparent"
|
||||||
>
|
>
|
||||||
Movie Library
|
Media Library
|
||||||
</h1>
|
</h1>
|
||||||
<MediaList
|
<MediaList
|
||||||
v-auto-animate
|
v-auto-animate
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import { ref } from 'vue'
|
|||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const movieId = ref(route.params.id as string)
|
const mediaId = ref(route.params.id as string)
|
||||||
const movieName = ref(route.params.name as string)
|
const mediaName = ref(route.params.name as string)
|
||||||
const isLoaded = ref(false)
|
const isLoaded = ref(false)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ const isLoaded = ref(false)
|
|||||||
<h1 class="text-3xl font-bold text-gray-700">
|
<h1 class="text-3xl font-bold text-gray-700">
|
||||||
Watch <br />
|
Watch <br />
|
||||||
<span class="bg-linear-to-r from-indigo-500 to-cyan-400 bg-clip-text text-transparent">
|
<span class="bg-linear-to-r from-indigo-500 to-cyan-400 bg-clip-text text-transparent">
|
||||||
{{ movieName }}
|
{{ mediaName }}
|
||||||
</span>
|
</span>
|
||||||
</h1>
|
</h1>
|
||||||
<span class="badge badge-warning">Experimental</span>
|
<span class="badge badge-warning">Experimental</span>
|
||||||
@@ -33,7 +33,7 @@ const isLoaded = ref(false)
|
|||||||
<!-- Responsive iframe -->
|
<!-- Responsive iframe -->
|
||||||
<div v-show="isLoaded" class="w-full aspect-video rounded-lg overflow-hidden shadow-lg">
|
<div v-show="isLoaded" class="w-full aspect-video rounded-lg overflow-hidden shadow-lg">
|
||||||
<iframe
|
<iframe
|
||||||
:src="'https://vidlink.pro/movie/' + movieId + '?autoplay=true&title=false'"
|
:src="'https://vidlink.pro/movie/' + mediaId + '?autoplay=true&title=false'"
|
||||||
frameborder="0"
|
frameborder="0"
|
||||||
allowfullscreen
|
allowfullscreen
|
||||||
class="w-full h-full"
|
class="w-full h-full"
|
||||||
|
|||||||
Reference in New Issue
Block a user