Enhance deployment script and update package dependencies
- Added detailed labels to the deployment script for IndeedHub, including title, version, description, license, icon, and repository URL. - Updated package dependencies in package.json and package-lock.json, including upgrading 'nostr-tools' to version 2.23.0 and adding 'axios' and '@tanstack/vue-query'. - Improved README with a modern description of the platform and updated project structure details. This commit enhances the clarity of the deployment process and ensures the project is using the latest dependencies for better performance and features.
This commit is contained in:
111
src/services/content.service.ts
Normal file
111
src/services/content.service.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
import { apiService } from './api.service'
|
||||
import type { ApiProject, ApiContent } from '../types/api'
|
||||
|
||||
/**
|
||||
* Content Service
|
||||
* Handles projects and content data
|
||||
*/
|
||||
class ContentService {
|
||||
/**
|
||||
* Get all published projects with optional filters
|
||||
*/
|
||||
async getProjects(filters?: {
|
||||
type?: 'film' | 'episodic' | 'music-video'
|
||||
status?: string
|
||||
genre?: string
|
||||
limit?: number
|
||||
page?: number
|
||||
}): Promise<ApiProject[]> {
|
||||
const params = new URLSearchParams()
|
||||
|
||||
if (filters?.type) params.append('type', filters.type)
|
||||
if (filters?.status) params.append('status', filters.status)
|
||||
if (filters?.genre) params.append('genre', filters.genre)
|
||||
if (filters?.limit) params.append('limit', filters.limit.toString())
|
||||
if (filters?.page) params.append('page', filters.page.toString())
|
||||
|
||||
const url = `/projects${params.toString() ? `?${params.toString()}` : ''}`
|
||||
return apiService.get<ApiProject[]>(url)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get project by ID
|
||||
*/
|
||||
async getProjectById(id: string): Promise<ApiProject> {
|
||||
return apiService.get<ApiProject>(`/projects/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get project by slug
|
||||
*/
|
||||
async getProjectBySlug(slug: string): Promise<ApiProject> {
|
||||
return apiService.get<ApiProject>(`/projects/slug/${slug}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get content by ID
|
||||
*/
|
||||
async getContentById(id: string): Promise<ApiContent> {
|
||||
return apiService.get<ApiContent>(`/contents/${id}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all contents for a project
|
||||
*/
|
||||
async getContentsByProject(projectId: string): Promise<ApiContent[]> {
|
||||
return apiService.get<ApiContent[]>(`/contents/project/${projectId}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get streaming URL for content (requires subscription or rental)
|
||||
*/
|
||||
async getStreamingUrl(contentId: string): Promise<{ url: string; drmToken?: string }> {
|
||||
return apiService.get<{ url: string; drmToken?: string }>(`/contents/${contentId}/stream`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Search projects
|
||||
*/
|
||||
async searchProjects(query: string, filters?: {
|
||||
type?: string
|
||||
genre?: string
|
||||
}): Promise<ApiProject[]> {
|
||||
const params = new URLSearchParams()
|
||||
params.append('q', query)
|
||||
|
||||
if (filters?.type) params.append('type', filters.type)
|
||||
if (filters?.genre) params.append('genre', filters.genre)
|
||||
|
||||
return apiService.get<ApiProject[]>(`/projects/search?${params.toString()}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* Get featured content (top-rated, recent releases)
|
||||
*/
|
||||
async getFeaturedContent(): Promise<ApiProject[]> {
|
||||
return apiService.get<ApiProject[]>('/projects?status=published&featured=true')
|
||||
}
|
||||
|
||||
/**
|
||||
* Get genres
|
||||
*/
|
||||
async getGenres(): Promise<Array<{ id: string; name: string; slug: string }>> {
|
||||
return apiService.get('/genres')
|
||||
}
|
||||
|
||||
/**
|
||||
* Get festivals
|
||||
*/
|
||||
async getFestivals(): Promise<Array<{ id: string; name: string; slug: string }>> {
|
||||
return apiService.get('/festivals')
|
||||
}
|
||||
|
||||
/**
|
||||
* Get awards
|
||||
*/
|
||||
async getAwards(): Promise<Array<{ id: string; name: string; slug: string }>> {
|
||||
return apiService.get('/awards')
|
||||
}
|
||||
}
|
||||
|
||||
export const contentService = new ContentService()
|
||||
Reference in New Issue
Block a user