Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

v0.3.0 #129

Merged
merged 78 commits into from
Nov 30, 2023
Merged
Changes from 1 commit
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
acad48e
feat: implement automatic removal of old theme songs (#128)
ReenigneArcher Aug 1, 2023
9d54df5
feat: add theme completion report (#130)
ReenigneArcher Aug 5, 2023
ed1ae2d
fix(ci): localization workflow fails to install python-plexapi (#134)
ReenigneArcher Aug 5, 2023
ddef443
ci(localization): fix git diff (#135)
ReenigneArcher Aug 6, 2023
bbdf774
ci(localization): fix localization path (#136)
ReenigneArcher Aug 6, 2023
ffa4fa6
ci(tests): test python dependencies (#137)
ReenigneArcher Aug 6, 2023
de5aed5
fix(localization): fix translation file names (#138)
ReenigneArcher Aug 6, 2023
02d0977
New Crowdin updates (#133)
ReenigneArcher Aug 7, 2023
aaa5e12
feat: add support for collections (#140)
ReenigneArcher Aug 25, 2023
b5de215
New Babel Updates (#145)
LizardByte-bot Aug 25, 2023
6f45eff
build(deps): bump peter-evans/create-pull-request from 4 to 5 (#139)
dependabot[bot] Aug 25, 2023
7bdcbb4
ci: update global workflows (#146)
LizardByte-bot Aug 25, 2023
b8301e0
ci: update global docker (#147)
LizardByte-bot Aug 25, 2023
5cfd567
docs: fix readthedocs build (#150)
ReenigneArcher Sep 6, 2023
66215e8
build(deps): use python-plexapi-backport (#152)
ReenigneArcher Sep 7, 2023
aacfbe9
ci(tests): bootstrap plex server (#153)
ReenigneArcher Sep 22, 2023
cc33cbf
ci: update global docker (#161)
LizardByte-bot Sep 22, 2023
2603943
ci: update global python (#160)
LizardByte-bot Sep 22, 2023
3f1b450
ci: update global workflows (#159)
LizardByte-bot Sep 22, 2023
95b26d1
build(deps): bump actions/checkout from 3 to 4 (#149)
dependabot[bot] Sep 22, 2023
d2b1c9c
New Crowdin updates (#142)
ReenigneArcher Sep 22, 2023
772499e
build(deps): use plexhints from pypi (#162)
ReenigneArcher Sep 28, 2023
11996a1
ci: update global workflows (#172)
LizardByte-bot Oct 5, 2023
964b3b9
ci: update global workflows (#173)
LizardByte-bot Oct 5, 2023
4778272
ci: use new LizardByte setup python action (#174)
ReenigneArcher Oct 6, 2023
caee348
ci: update global workflows (#177)
LizardByte-bot Oct 9, 2023
71f2d9a
ci: update global workflows (#179)
LizardByte-bot Oct 10, 2023
4269c4c
ci: update release notifier (#180)
LizardByte-bot Oct 10, 2023
761b234
New translations themerr-plex.po (French) (#181)
ReenigneArcher Oct 11, 2023
9475d8a
ci: update global workflows (#182)
LizardByte-bot Oct 12, 2023
9a557b1
ci: update release notifier (#183)
LizardByte-bot Oct 16, 2023
9e18f7c
test: fix macos functional test (#186)
ReenigneArcher Oct 17, 2023
cbbd71a
test: increase plugin log search timeout (#187)
ReenigneArcher Oct 18, 2023
4dcfbb9
build(deps-dev): bump plexhints from 0.1.0 to 0.1.1 (#185)
dependabot[bot] Oct 18, 2023
c5b6196
build(deps): bump LizardByte/plexhints from 0.1.0 to 0.1.1 (#184)
dependabot[bot] Oct 18, 2023
094ffba
build(deps): bump plexapi-backport[alert] from 4.15.2 to 4.15.4 (#171)
dependabot[bot] Oct 18, 2023
41dcc52
build(deps): bump bootstrap from 5.2.2 to 5.3.2 (#165)
dependabot[bot] Oct 18, 2023
8269b52
build(deps): bump jquery from 3.7.0 to 3.7.1 (#167)
dependabot[bot] Oct 18, 2023
f8c0639
build(deps): bump @fortawesome/fontawesome-free from 6.2.0 to 6.4.2 (…
dependabot[bot] Oct 18, 2023
c44d595
build(deps): bump @fontsource/open-sans from 4.5.13 to 5.0.15 (#176)
dependabot[bot] Oct 18, 2023
bd590ca
test: wait until plugin is ready (#188)
ReenigneArcher Oct 18, 2023
f311246
ci: use tagged setup python action (#191)
ReenigneArcher Oct 24, 2023
328c938
build(deps): bump plexhints and plexapi-backport (#198)
ReenigneArcher Nov 6, 2023
15099a5
ci: use commit hash for setup python action (#193)
ReenigneArcher Nov 6, 2023
a1e1847
Fix AlertListener on IPv6-aware hosts (#201)
zdimension Nov 7, 2023
f32a6c9
fix: Add error handling around update_plex_item to prevent hang (#202)
zdimension Nov 7, 2023
4feddda
Add error handling and logging for Youtube-DL (#200)
zdimension Nov 7, 2023
09f5253
build(deps): bump LizardByte/plexhints from 0.1.2 to 0.1.3 (#205)
dependabot[bot] Nov 8, 2023
d7cebc8
build(deps-dev): bump plexhints from 0.1.2 to 0.1.3 (#206)
dependabot[bot] Nov 8, 2023
dadf374
feat: Add support for passing session cookies to Youtube-DL (#203)
zdimension Nov 8, 2023
d04fad4
fix: Move skip check before call to Youtube-DL (#204)
zdimension Nov 8, 2023
2aa84ca
New Crowdin updates (#194)
ReenigneArcher Nov 8, 2023
45ce809
build(deps): bump @fontsource/open-sans from 5.0.15 to 5.0.17 (#190)
dependabot[bot] Nov 8, 2023
b463749
fix: disable auto-reload since it is not needed and only harms perf (…
zdimension Nov 8, 2023
af7462c
fix: use correct types for plex item typehints (#211)
ReenigneArcher Nov 11, 2023
ccee561
feat: Prefetch items from ThemerrDB, and differentiate items with no …
zdimension Nov 11, 2023
3c4c02b
New Babel Updates (#212)
LizardByte-bot Nov 11, 2023
308d1fa
New Crowdin updates (#213)
ReenigneArcher Nov 11, 2023
b9dc77c
fix: fix css (#214)
zdimension Nov 12, 2023
9057aed
build(deps): bump youtube-dl (#164)
ReenigneArcher Nov 13, 2023
aba0560
fix(ui): progress bar will now fill to max (#217)
ReenigneArcher Nov 13, 2023
400052c
feat: allow adding cookies from the UI directly and fix the ytdl bug …
zdimension Nov 14, 2023
5514c6b
build(deps): bump plexapi-backport[alert] from 4.15.5 to 4.15.6 (#219)
dependabot[bot] Nov 15, 2023
1891d60
fix: correct issue where database_cache may be updated in parallel (#…
ReenigneArcher Nov 15, 2023
e2f5240
fix(ui): use correct action button for themerr provided items (#220)
ReenigneArcher Nov 16, 2023
7f3dd86
fix(ui): correct issue where themerr-provided field may not be accura…
ReenigneArcher Nov 16, 2023
4f9ffa3
New Babel Updates (#222)
LizardByte-bot Nov 16, 2023
dfda394
fix(ui): improve speed of dashboard by caching data (#224)
ReenigneArcher Nov 17, 2023
12c78b8
New Babel Updates (#225)
LizardByte-bot Nov 17, 2023
1a91752
fix: don't update locked fields + unlock fields after update (#208)
zdimension Nov 18, 2023
eb07188
fix: use item original title if present (#226)
zdimension Nov 20, 2023
3180e9c
fix: disable Plex plugin framework sandbox and add back all missing b…
zdimension Nov 21, 2023
25a1d83
ci: update global workflows (#230)
LizardByte-bot Nov 24, 2023
4172903
chore: update LizardByte actions (#231)
ReenigneArcher Nov 28, 2023
673fe04
fix: remove unused youtube params (#232)
ReenigneArcher Nov 29, 2023
64f6a71
New Crowdin updates (#223)
ReenigneArcher Nov 29, 2023
7299600
build(deps): bump @fortawesome/fontawesome-free from 6.4.2 to 6.5.0 (…
dependabot[bot] Nov 29, 2023
f94afde
docs: update v0.3.0 changelog (#235)
ReenigneArcher Nov 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Contents/Code/constants.py
Original file line number Diff line number Diff line change
@@ -106,19 +106,22 @@
name='art',
themerr_data_key='art_url',
remove_pref='bool_remove_unused_art',
plex_field='art',
),
posters=dict(
method=lambda item: item.uploadPoster,
type='posters',
name='poster',
themerr_data_key='poster_url',
remove_pref='bool_remove_unused_posters',
plex_field='thumb',
),
themes=dict(
method=lambda item: item.uploadTheme,
type='themes',
name='theme',
themerr_data_key='youtube_theme_url',
remove_pref='bool_remove_unused_theme_songs',
plex_field='theme',
),
)
94 changes: 61 additions & 33 deletions Contents/Code/plex_api_helper.py
Original file line number Diff line number Diff line change
@@ -175,46 +175,52 @@ def update_plex_item(rating_key):
else:
add_media(item=item, media_type='art', media_url_id=data['backdrop_path'], media_url=url)
# update summary
try:
summary = data['overview']
except KeyError:
pass
if item.isLocked(field='summary'):
Log.Debug('Not overwriting locked summary for collection: {}'.format(item.title))
else:
if item.summary != summary:
Log.Info('Updating summary for collection: {}'.format(item.title))
try:
item.editSummary(summary=summary, locked=False)
except Exception as e:
Log.Error('{}: Error updating summary: {}'.format(item.ratingKey, e))

# get youtube_url
try:
yt_video_url = data['youtube_theme_url']
except KeyError:
Log.Info('{}: No theme song found for {} ({})'.format(item.ratingKey, item.title, item.year))
try:
summary = data['overview']
except KeyError:
pass
else:
if item.summary != summary:
Log.Info('Updating summary for collection: {}'.format(item.title))
try:
item.editSummary(summary=summary, locked=False)
except Exception as e:
Log.Error('{}: Error updating summary: {}'.format(item.ratingKey, e))

if item.isLocked(field='theme'):
Log.Debug('Not overwriting locked theme for {}: {}'.format(item.type, item.title))
else:
settings_hash = general_helper.get_themerr_settings_hash()
themerr_data = general_helper.get_themerr_json_data(item=item)

# get youtube_url
try:
skip = themerr_data['settings_hash'] == settings_hash \
and themerr_data[media_type_dict['themes']['themerr_data_key']] == yt_video_url
yt_video_url = data['youtube_theme_url']
except KeyError:
skip = False

if skip:
Log.Info('Skipping {} for type: {}, title: {}, rating_key: {}'.format(
media_type_dict['themes']['name'], item.type, item.title, item.ratingKey
))
Log.Info('{}: No theme song found for {} ({})'.format(item.ratingKey, item.title, item.year))
else:
settings_hash = general_helper.get_themerr_settings_hash()
themerr_data = general_helper.get_themerr_json_data(item=item)

try:
theme_url = process_youtube(url=yt_video_url)
except Exception as e:
Log.Exception('{}: Error processing youtube url: {}'.format(item.ratingKey, e))
skip = themerr_data['settings_hash'] == settings_hash \
and themerr_data[media_type_dict['themes']['themerr_data_key']] == yt_video_url
except KeyError:
skip = False

if skip:
Log.Info('Skipping {} for type: {}, title: {}, rating_key: {}'.format(
media_type_dict['themes']['name'], item.type, item.title, item.ratingKey
))
else:
if theme_url:
add_media(item=item, media_type='themes',
media_url_id=yt_video_url, media_url=theme_url)
try:
theme_url = process_youtube(url=yt_video_url)
except Exception as e:
Log.Exception('{}: Error processing youtube url: {}'.format(item.ratingKey, e))
else:
if theme_url:
add_media(item=item, media_type='themes',
media_url_id=yt_video_url, media_url=theme_url)


def add_media(item, media_type, media_url_id, media_file=None, media_url=None):
@@ -253,6 +259,12 @@ def add_media(item, media_type, media_url_id, media_file=None, media_url=None):
settings_hash = general_helper.get_themerr_settings_hash()
themerr_data = general_helper.get_themerr_json_data(item=item)

if item.isLocked(field=media_type_dict[media_type]['plex_field']):
Log.Info('Not overwriting locked "{}" for {}: {}'.format(
media_type_dict[media_type]['name'], item.type, item.title
))
return False

if media_file or media_url:
global plex
if not plex:
@@ -298,6 +310,22 @@ def add_media(item, media_type, media_url_id, media_file=None, media_url=None):
new_themerr_data[media_type_dict[media_type]['themerr_data_key']] = media_url_id

general_helper.update_themerr_data_file(item=item, new_themerr_data=new_themerr_data)

# unlock the field since it contains an automatically added value
edit_field = "{}.locked".format(media_type_dict[media_type]['plex_field'])
edits = {
edit_field: 0,
}
count = 0
while count < 3: # there are random read timeouts
try:
item.edit(**edits)
except requests.ReadTimeout as e:
Log.Error('{}: Error unlocking field: {}'.format(item.ratingKey, e))
time.sleep(5)
count += 1
else:
break
else:
Log.Debug('Could not upload {} for type: {}, title: {}, rating_key: {}'.format(
media_type_dict[media_type]['name'], item.type, item.title, item.ratingKey