mirror of
https://github.com/morpheus65535/bazarr.git
synced 2025-04-23 06:08:00 -04:00
Added support for series monitored status. #1964
This commit is contained in:
parent
25b8738c05
commit
af70cf1fc9
8 changed files with 32 additions and 14 deletions
|
@ -38,6 +38,7 @@ class Series(Resource):
|
|||
'episodeMissingCount': fields.Integer(),
|
||||
'fanart': fields.String(),
|
||||
'imdbId': fields.String(),
|
||||
'monitored': fields.Boolean(),
|
||||
'overview': fields.String(),
|
||||
'path': fields.String(),
|
||||
'poster': fields.String(),
|
||||
|
|
|
@ -215,6 +215,7 @@ class TableShows(BaseModel):
|
|||
audio_language = TextField(null=True)
|
||||
fanart = TextField(null=True)
|
||||
imdbId = TextField(default='""', null=True)
|
||||
monitored = TextField(null=True)
|
||||
overview = TextField(null=True)
|
||||
path = TextField(unique=True)
|
||||
poster = TextField(null=True)
|
||||
|
@ -302,6 +303,7 @@ def migrate_db():
|
|||
migrator.add_column('table_shows', 'seriesType', TextField(default='""', null=True)),
|
||||
migrator.add_column('table_shows', 'imdbId', TextField(default='""', null=True)),
|
||||
migrator.add_column('table_shows', 'profileId', IntegerField(null=True)),
|
||||
migrator.add_column('table_shows', 'monitored', TextField(null=True)),
|
||||
migrator.add_column('table_episodes', 'format', TextField(null=True)),
|
||||
migrator.add_column('table_episodes', 'resolution', TextField(null=True)),
|
||||
migrator.add_column('table_episodes', 'video_codec', TextField(null=True)),
|
||||
|
@ -384,6 +386,7 @@ def get_exclusion_clause(exclusion_type):
|
|||
monitoredOnly = settings.sonarr.getboolean('only_monitored')
|
||||
if monitoredOnly:
|
||||
where_clause.append((TableEpisodes.monitored == 'True'))
|
||||
where_clause.append((TableShows.monitored == 'True'))
|
||||
else:
|
||||
monitoredOnly = settings.radarr.getboolean('only_monitored')
|
||||
if monitoredOnly:
|
||||
|
|
|
@ -13,6 +13,7 @@ from collections import deque
|
|||
from time import sleep
|
||||
|
||||
from constants import headers
|
||||
from app.event_handler import event_stream
|
||||
from sonarr.sync.episodes import sync_episodes, sync_one_episode
|
||||
from sonarr.sync.series import update_series, update_one_series
|
||||
from radarr.sync.movies import update_movies, update_one_movie
|
||||
|
@ -274,6 +275,7 @@ def dispatcher(data):
|
|||
except Exception as e:
|
||||
logging.debug('BAZARR an exception occurred while parsing SignalR feed: {}'.format(repr(e)))
|
||||
finally:
|
||||
event_stream(type='badges')
|
||||
return
|
||||
|
||||
|
||||
|
|
|
@ -52,7 +52,8 @@ def seriesParser(show, action, tags_dict, serie_default_profile, audio_profiles)
|
|||
'alternateTitles': alternate_titles,
|
||||
'tags': str(tags),
|
||||
'seriesType': show['seriesType'],
|
||||
'imdbId': imdbId}
|
||||
'imdbId': imdbId,
|
||||
'monitored': str(bool(show['monitored']))}
|
||||
else:
|
||||
return {'title': show["title"],
|
||||
'path': show["path"],
|
||||
|
@ -68,7 +69,8 @@ def seriesParser(show, action, tags_dict, serie_default_profile, audio_profiles)
|
|||
'tags': str(tags),
|
||||
'seriesType': show['seriesType'],
|
||||
'imdbId': imdbId,
|
||||
'profileId': serie_default_profile}
|
||||
'profileId': serie_default_profile,
|
||||
'monitored': str(bool(show['monitored']))}
|
||||
|
||||
|
||||
def profile_id_to_language(id_, profiles):
|
||||
|
|
|
@ -100,7 +100,8 @@ def update_series(send_event=True):
|
|||
TableShows.alternateTitles,
|
||||
TableShows.tags,
|
||||
TableShows.seriesType,
|
||||
TableShows.imdbId).dicts()
|
||||
TableShows.imdbId,
|
||||
TableShows.monitored).dicts()
|
||||
|
||||
for item in series_in_db:
|
||||
series_in_db_list.append(item)
|
||||
|
|
|
@ -6,7 +6,9 @@ import { ItemEditModal } from "@/components/forms/ItemEditForm";
|
|||
import { useModals } from "@/modules/modals";
|
||||
import ItemView from "@/pages/views/ItemView";
|
||||
import { useTableStyles } from "@/styles";
|
||||
import { faWrench } from "@fortawesome/free-solid-svg-icons";
|
||||
import { faBookmark as farBookmark } from "@fortawesome/free-regular-svg-icons";
|
||||
import { faBookmark, faWrench } from "@fortawesome/free-solid-svg-icons";
|
||||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
|
||||
import { Anchor, Container, Progress } from "@mantine/core";
|
||||
import { useDocumentTitle } from "@mantine/hooks";
|
||||
import { FunctionComponent, useMemo } from "react";
|
||||
|
@ -20,6 +22,15 @@ const SeriesView: FunctionComponent = () => {
|
|||
|
||||
const columns: Column<Item.Series>[] = useMemo<Column<Item.Series>[]>(
|
||||
() => [
|
||||
{
|
||||
accessor: "monitored",
|
||||
Cell: ({ value }) => (
|
||||
<FontAwesomeIcon
|
||||
title={value ? "monitored" : "unmonitored"}
|
||||
icon={value ? faBookmark : farBookmark}
|
||||
></FontAwesomeIcon>
|
||||
),
|
||||
},
|
||||
{
|
||||
Header: "Name",
|
||||
accessor: "title",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Language } from "@/components/bazarr";
|
||||
import { BuildKey, isMovie } from "@/utilities";
|
||||
import { BuildKey } from "@/utilities";
|
||||
import {
|
||||
useLanguageProfileBy,
|
||||
useProfileItemsToLanguages,
|
||||
|
@ -165,14 +165,12 @@ const ItemOverview: FunctionComponent<Props> = (props) => {
|
|||
<Group align="flex-start" noWrap className={classes.group}>
|
||||
<Title my={0}>
|
||||
<Text inherit color="white">
|
||||
{item && isMovie(item) ? (
|
||||
<Box component="span" mr={12}>
|
||||
<FontAwesomeIcon
|
||||
title={item.monitored ? "monitored" : "unmonitored"}
|
||||
icon={item.monitored ? faBookmark : farBookmark}
|
||||
></FontAwesomeIcon>
|
||||
</Box>
|
||||
) : null}
|
||||
<Box component="span" mr={12}>
|
||||
<FontAwesomeIcon
|
||||
title={item?.monitored ? "unmonitored" : "monitored"}
|
||||
icon={item?.monitored ? faBookmark : farBookmark}
|
||||
></FontAwesomeIcon>
|
||||
</Box>
|
||||
{item?.title}
|
||||
</Text>
|
||||
</Title>
|
||||
|
|
2
frontend/src/types/api.d.ts
vendored
2
frontend/src/types/api.d.ts
vendored
|
@ -109,6 +109,7 @@ declare namespace Item {
|
|||
type Base = PathType &
|
||||
TitleType &
|
||||
TagType &
|
||||
MonitoredType &
|
||||
AudioLanguageType & {
|
||||
profileId: number | null;
|
||||
fanart: string;
|
||||
|
@ -130,7 +131,6 @@ declare namespace Item {
|
|||
|
||||
type Movie = Base &
|
||||
MovieIdType &
|
||||
MonitoredType &
|
||||
SubtitleType &
|
||||
MissingSubtitleType &
|
||||
SceneNameType & {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue