mirror of
https://github.com/morpheus65535/bazarr.git
synced 2024-11-11 01:23:38 +08:00
Finished development
This commit is contained in:
parent
2c97d0ba72
commit
03b5cc456e
5 changed files with 35 additions and 17 deletions
|
@ -52,7 +52,7 @@ def sync_episodes():
|
|||
|
||||
seriesIdListLength = len(seriesIdList)
|
||||
for i, seriesId in enumerate(seriesIdList, 1):
|
||||
notifications.write(msg='Getting episodes data from Sonarr...', queue='get_episodes', item=i, length=seriesIdListLength)
|
||||
notifications.write(msg='Getting episodes data from Sonarr...', queue='get_episodes', item=i, length=seriesIdListLength, duration='long')
|
||||
# Get episodes data for a series from Sonarr
|
||||
url_sonarr_api_episode = url_sonarr + "/api/episode?seriesId=" + str(seriesId[0]) + "&apikey=" + apikey_sonarr
|
||||
try:
|
||||
|
|
|
@ -50,8 +50,10 @@ def update_movies():
|
|||
movies_to_update = []
|
||||
movies_to_add = []
|
||||
|
||||
for movie in r.json():
|
||||
notifications.write(msg="Getting data for this movie: " + movie['title'], queue='get_movies')
|
||||
moviesIdListLength = len(r.json())
|
||||
for i, movie in enumerate(r.json(), 1):
|
||||
notifications.write(msg="Getting data for this movie...", queue='get_movies', item=i,
|
||||
length=moviesIdListLength, duration='long')
|
||||
if movie['hasFile'] is True:
|
||||
if 'movieFile' in movie:
|
||||
if movie["path"] != None and movie['movieFile']['relativePath'] != None:
|
||||
|
|
|
@ -453,7 +453,7 @@ def series_download_subtitles(no):
|
|||
for i, episode in enumerate(episodes_details, 1):
|
||||
for language in ast.literal_eval(episode[1]):
|
||||
if language is not None:
|
||||
notifications.write(msg='Searching for series subtitles : ' + str(i) + '/' + str(count_episodes_details), queue='get_subtitle', duration='long', item=i, length=count_episodes_details)
|
||||
notifications.write(msg='Searching for series subtitles', queue='get_subtitle', duration='long', item=i, length=count_episodes_details)
|
||||
result = download_subtitle(path_replace(episode[0]), str(alpha3_from_alpha2(language)),
|
||||
series_details[0], providers_list, providers_auth, str(episode[3]),
|
||||
series_details[1], 'series')
|
||||
|
@ -486,7 +486,7 @@ def movies_download_subtitles(no):
|
|||
|
||||
for i, language in enumerate(ast.literal_eval(movie[1]), 1):
|
||||
if language is not None:
|
||||
notifications.write(msg='Searching for movies subtitles : ' + str(i) + '/' + str(count_movie), queue='get_subtitle', duration='long', item=i, length=count_movie)
|
||||
notifications.write(msg='Searching for movies subtitles', queue='get_subtitle', duration='long', item=i, length=count_movie)
|
||||
result = download_subtitle(path_replace_movie(movie[0]), str(alpha3_from_alpha2(language)), movie[4],
|
||||
providers_list, providers_auth, str(movie[3]), movie[5], 'movie')
|
||||
if result is not None:
|
||||
|
@ -537,7 +537,7 @@ def wanted_download_subtitles(path, l, count_episodes):
|
|||
for i in range(len(attempt)):
|
||||
if attempt[i][0] == language:
|
||||
if search_active(attempt[i][1]):
|
||||
notifications.write(msg='Searching for series subtitles : ' + str(l) + '/' + str(count_episodes), queue='get_subtitle', duration='long', item=l, length=count_episodes)
|
||||
notifications.write(msg='Searching for series subtitles...', queue='get_subtitle', duration='long', item=l, length=count_episodes)
|
||||
result = download_subtitle(path_replace(episode[0]), str(alpha3_from_alpha2(language)),
|
||||
episode[4], providers_list, providers_auth, str(episode[5]),
|
||||
episode[7], 'series')
|
||||
|
@ -552,6 +552,8 @@ def wanted_download_subtitles(path, l, count_episodes):
|
|||
history_log(1, episode[3], episode[2], message, path, language_code, provider, score)
|
||||
send_notifications(episode[3], episode[2], message)
|
||||
else:
|
||||
notifications.write(msg='Searching for series subtitles', queue='get_subtitle', duration='long',
|
||||
item=l, length=count_episodes)
|
||||
logging.debug(
|
||||
'BAZARR Search is not active for episode ' + episode[0] + ' Language: ' + attempt[i][0])
|
||||
|
||||
|
@ -589,7 +591,7 @@ def wanted_download_subtitles_movie(path, l, count_movies):
|
|||
for i in range(len(attempt)):
|
||||
if attempt[i][0] == language:
|
||||
if search_active(attempt[i][1]) is True:
|
||||
notifications.write(msg='Searching for movies subtitles : ' + str(l) + '/' + str(count_movies), queue='get_subtitle', duration='long', item=l, length=count_movies)
|
||||
notifications.write(msg='Searching for movies subtitles...', queue='get_subtitle', duration='long', item=l, length=count_movies)
|
||||
result = download_subtitle(path_replace_movie(movie[0]), str(alpha3_from_alpha2(language)),
|
||||
movie[4], providers_list, providers_auth, str(movie[5]), movie[7],
|
||||
'movie')
|
||||
|
@ -604,6 +606,8 @@ def wanted_download_subtitles_movie(path, l, count_movies):
|
|||
history_log_movie(1, movie[3], message, path, language_code, provider, score)
|
||||
send_notifications_movie(movie[3], message)
|
||||
else:
|
||||
notifications.write(msg='Searching for movies subtitles...', queue='get_subtitle', duration='long',
|
||||
item=l, length=count_movies)
|
||||
logging.info(
|
||||
'BAZARR Search is not active for movie ' + movie[0] + ' Language: ' + attempt[i][0])
|
||||
|
||||
|
@ -640,7 +644,7 @@ def wanted_search_missing_subtitles():
|
|||
for i, episode in enumerate(episodes, 1):
|
||||
wanted_download_subtitles(episode[0], i, count_episodes)
|
||||
else:
|
||||
notifications.write(msg='BAZARR All providers are throttled', queue='get_subtitle')
|
||||
notifications.write(msg='BAZARR All providers are throttled', queue='get_subtitle', duration='long')
|
||||
logging.info("BAZARR All providers are throttled")
|
||||
|
||||
if settings.general.getboolean('use_radarr'):
|
||||
|
@ -775,8 +779,8 @@ def upgrade_subtitles():
|
|||
|
||||
for i, episode in enumerate(episodes_to_upgrade, 1):
|
||||
if episode[1] in ast.literal_eval(str(episode[9])):
|
||||
notifications.write(msg='Upgrading series subtitles : ' + str(i) + '/' + str(count_episode_to_upgrade),
|
||||
queue='get_subtitle', duration='long', item=i, length=count_episode_to_upgrade)
|
||||
notifications.write(msg='Upgrading series subtitles...',
|
||||
queue='upgrade_subtitle', duration='long', item=i, length=count_episode_to_upgrade)
|
||||
result = download_subtitle(path_replace(episode[0]), str(alpha3_from_alpha2(episode[1])),
|
||||
episode[3], providers_list, providers_auth, str(episode[4]),
|
||||
episode[5], 'series', forced_minimum_score=int(episode[2]), is_upgrade=True)
|
||||
|
@ -792,8 +796,8 @@ def upgrade_subtitles():
|
|||
|
||||
for i, movie in enumerate(movies_to_upgrade, 1):
|
||||
if movie[1] in ast.literal_eval(str(movie[8])):
|
||||
notifications.write(msg='Upgrading movie subtitles : ' + str(i) + '/' + str(count_movie_to_upgrade),
|
||||
queue='get_subtitle', duration='long', item=i, length=count_movie_to_upgrade)
|
||||
notifications.write(msg='Upgrading movie subtitles...',
|
||||
queue='upgrade_subtitle', duration='long', item=i, length=count_movie_to_upgrade)
|
||||
result = download_subtitle(path_replace_movie(movie[0]), str(alpha3_from_alpha2(movie[1])),
|
||||
movie[3], providers_list, providers_auth, str(movie[4]),
|
||||
movie[5], 'movie', forced_minimum_score=int(movie[2]), is_upgrade=True)
|
||||
|
|
|
@ -301,8 +301,8 @@ def series_full_scan_subtitles():
|
|||
count_episodes = len(episodes)
|
||||
|
||||
for i, episode in enumerate(episodes, 1):
|
||||
notifications.write(msg='Updating all episodes subtitles from disk : ' + str(i) + '/' + str(count_episodes),
|
||||
queue='list_subtitles_episodes', duration='long', item=i, length=count_episodes)
|
||||
notifications.write(msg='Updating all episodes subtitles from disk...',
|
||||
queue='list_subtitles_series', duration='long', item=i, length=count_episodes)
|
||||
store_subtitles(path_replace(episode[0]))
|
||||
|
||||
gc.collect()
|
||||
|
@ -316,7 +316,7 @@ def movies_full_scan_subtitles():
|
|||
count_movies = len(movies)
|
||||
|
||||
for i, movie in enumerate(movies, 1):
|
||||
notifications.write(msg='Updating all movies subtitles from disk : ' + str(i) + '/' + str(count_movies),
|
||||
notifications.write(msg='Updating all movies subtitles from disk...',
|
||||
queue='list_subtitles_movies', duration='long', item=i, length=count_movies)
|
||||
store_subtitles_movie(path_replace_movie(movie[0]))
|
||||
|
||||
|
|
|
@ -19,6 +19,14 @@
|
|||
.searchicon {
|
||||
color: white !important;
|
||||
}
|
||||
.ui.progress .bar>.progress {
|
||||
right: auto;
|
||||
left: .5em;
|
||||
color: black !important;
|
||||
}
|
||||
.ui.disabled.progress.notification_progress {
|
||||
opacity: unset !important;
|
||||
}
|
||||
div.disabled { pointer-events: none; }
|
||||
button.disabled { pointer-events: none; }
|
||||
</style>
|
||||
|
@ -300,7 +308,11 @@
|
|||
duration : 0,
|
||||
autoSuccess: false,
|
||||
value : item,
|
||||
total : length
|
||||
total : length,
|
||||
label: 'ratio',
|
||||
text: {
|
||||
ratio: '{value} / {total}'
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue