Enhance Docker and backend configurations for improved deployment
- Updated docker-compose.yml to include environment variable support for services, enhancing flexibility in configuration. - Refactored Dockerfile to utilize build arguments for VITE environment variables, allowing for better customization during builds. - Improved Nginx configuration to handle larger video uploads by increasing client_max_body_size to 5GB. - Enhanced backend Dockerfile to include wget for health checks and improved startup logging for database migrations. - Added validation for critical environment variables in the backend to ensure necessary configurations are present before application startup. - Updated content streaming logic to support direct HLS URL construction, improving streaming reliability and user experience. - Refactored various components and services to streamline access checks and improve error handling during content playback.
This commit is contained in:
@@ -115,15 +115,21 @@ export const useContentStore = defineStore('content', () => {
|
||||
|
||||
const films = allContent.filter(c => c.type === 'film')
|
||||
const bitcoinContent = allContent.filter(c =>
|
||||
c.categories?.some(cat => cat.toLowerCase().includes('bitcoin') || cat.toLowerCase().includes('documentary'))
|
||||
c.categories?.some(cat => cat.toLowerCase().includes('bitcoin'))
|
||||
)
|
||||
const docs = allContent.filter(c =>
|
||||
c.categories?.some(cat => cat.toLowerCase().includes('documentary'))
|
||||
)
|
||||
const dramaContent = allContent.filter(c =>
|
||||
c.categories?.some(cat => cat.toLowerCase().includes('drama'))
|
||||
)
|
||||
|
||||
contentRows.value = {
|
||||
featured: allContent.slice(0, 10),
|
||||
newReleases: films.slice(0, 8),
|
||||
bitcoin: bitcoinContent.length > 0 ? bitcoinContent : films.slice(0, 6),
|
||||
documentaries: allContent.slice(0, 10),
|
||||
dramas: films.slice(0, 6),
|
||||
documentaries: docs.length > 0 ? docs : allContent.slice(0, 10),
|
||||
dramas: dramaContent.length > 0 ? dramaContent : films.slice(0, 6),
|
||||
independent: films.slice(0, 10)
|
||||
}
|
||||
} catch (err) {
|
||||
@@ -240,6 +246,7 @@ export const useContentStore = defineStore('content', () => {
|
||||
rentalPrice: p.film?.rentalPrice ?? p.rentalPrice,
|
||||
status: p.status,
|
||||
apiData: p,
|
||||
isOwnProject: true,
|
||||
}))
|
||||
|
||||
// Merge into each content row (prepend so they appear first)
|
||||
@@ -278,29 +285,39 @@ export const useContentStore = defineStore('content', () => {
|
||||
|
||||
/**
|
||||
* Main fetch content method.
|
||||
* When USE_MOCK is false and the self-hosted API URL is configured,
|
||||
* always try the self-hosted backend first (regardless of the
|
||||
* content-source toggle, which only affects mock catalogues).
|
||||
* Respects the content-source toggle:
|
||||
* - 'indeehub-api' → self-hosted backend API
|
||||
* - 'topdocfilms' → TopDoc mock catalog (YouTube documentaries)
|
||||
* - 'indeehub' → IndeeHub mock catalog
|
||||
*/
|
||||
async function fetchContent() {
|
||||
loading.value = true
|
||||
error.value = null
|
||||
|
||||
try {
|
||||
const sourceStore = useContentSourceStore()
|
||||
const apiUrl = import.meta.env.VITE_INDEEHUB_API_URL || ''
|
||||
|
||||
if (USE_MOCK_DATA) {
|
||||
// Use mock data in development or when flag is set
|
||||
await new Promise(resolve => setTimeout(resolve, 100))
|
||||
await fetchContentFromMock()
|
||||
} else if (apiUrl) {
|
||||
// Self-hosted backend is configured — always prefer it
|
||||
} else if (sourceStore.activeSource === 'indeehub-api' && apiUrl) {
|
||||
// Self-hosted backend API
|
||||
await fetchContentFromIndeehubApi()
|
||||
await mergePublishedFilmmakerProjects()
|
||||
} else if (sourceStore.activeSource === 'topdocfilms') {
|
||||
// TopDoc curated catalog (free YouTube documentaries)
|
||||
fetchTopDocMock()
|
||||
await mergePublishedFilmmakerProjects()
|
||||
} else if (sourceStore.activeSource === 'indeehub') {
|
||||
// IndeeHub mock catalog
|
||||
fetchIndeeHubMock()
|
||||
await mergePublishedFilmmakerProjects()
|
||||
} else if (apiUrl) {
|
||||
// Fallback to API if source is unknown but API is configured
|
||||
await fetchContentFromIndeehubApi()
|
||||
// Also merge filmmaker's published projects that may not be in the
|
||||
// public results yet (e.g. content still transcoding)
|
||||
await mergePublishedFilmmakerProjects()
|
||||
} else {
|
||||
// No self-hosted backend — try external API
|
||||
await fetchContentFromApi()
|
||||
await mergePublishedFilmmakerProjects()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user