expand user permissions
This commit is contained in:
@@ -14,11 +14,12 @@ import { isBrowserPlayable } from '@/lib/browser-media'
|
||||
|
||||
interface Props {
|
||||
libraryId: string
|
||||
readOnly?: boolean
|
||||
}
|
||||
|
||||
type ViewLevel = 'series' | 'seasons' | 'episodes'
|
||||
|
||||
export default function TvView({ libraryId }: Props) {
|
||||
export default function TvView({ libraryId, readOnly }: Props) {
|
||||
const [view, setView] = useState<ViewLevel>('series')
|
||||
const [series, setSeries] = useState<TvSeries[]>([])
|
||||
const [seasons, setSeasons] = useState<TvSeason[]>([])
|
||||
@@ -434,6 +435,7 @@ export default function TvView({ libraryId }: Props) {
|
||||
onPrev={playingEpisodeIndex > 0 ? () => setPlayingEpisodeIndex((i) => (i !== null ? i - 1 : null)) : undefined}
|
||||
onNext={playingEpisodeIndex < episodes.length - 1 ? () => setPlayingEpisodeIndex((i) => (i !== null ? i + 1 : null)) : undefined}
|
||||
context="tv"
|
||||
readOnly={readOnly}
|
||||
/>
|
||||
)
|
||||
}
|
||||
@@ -1000,7 +1002,7 @@ export default function TvView({ libraryId }: Props) {
|
||||
|
||||
{/* Floating controls — tag + close */}
|
||||
<div className="absolute top-4 right-4 z-10 flex items-center gap-1.5" onClick={(e) => e.stopPropagation()}>
|
||||
{view === 'seasons' && selectedSeries?.item_key && !showTagPanel && (
|
||||
{view === 'seasons' && selectedSeries?.item_key && !showTagPanel && !readOnly && (
|
||||
<button
|
||||
onClick={() => { setShowTagPanel(true); setTagPanelItemKey(selectedSeries.item_key!); setTagPanelDisabled(false) }}
|
||||
className={smallBtn}
|
||||
@@ -1077,6 +1079,7 @@ export default function TvView({ libraryId }: Props) {
|
||||
externalRefreshKey={tagRefreshKey}
|
||||
disabled={tagPanelDisabled}
|
||||
disabledMessage="Seasons cannot be tagged. Select an episode to tag it."
|
||||
readOnly={readOnly}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user