mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-18 08:43:37 +00:00
Merge branch 'feature/ChangeRenameEpisode' into dev
This commit is contained in:
commit
c4c35bea24
1 changed files with 21 additions and 18 deletions
|
@ -79,8 +79,8 @@ if coreid_warnings:
|
||||||
tz_p = du_parser()
|
tz_p = du_parser()
|
||||||
invalid_date_limit = datetime.date(1900, 1, 1)
|
invalid_date_limit = datetime.date(1900, 1, 1)
|
||||||
|
|
||||||
tba_tvinfo_name = re.compile(r'^(episode \d+|tb[ad])$', flags=re.I)
|
tba_tvinfo_name = re.compile(r'^(episode \d+|tb[acd])$', flags=re.I)
|
||||||
tba_file_name = re.compile(r'\b(episode.\d+|tb[ad])\b', flags=re.I)
|
tba_file_name = re.compile(r'\b(episode.\d+|tb[acd])\b', flags=re.I)
|
||||||
pattern_ep_name = re.compile(r'%E[._]?N', flags=re.I)
|
pattern_ep_name = re.compile(r'%E[._]?N', flags=re.I)
|
||||||
|
|
||||||
# status codes for switching tv show source
|
# status codes for switching tv show source
|
||||||
|
@ -4660,7 +4660,14 @@ class TVEpisode(TVEpisodeBase):
|
||||||
+ 'hastbn: %s\n' % self.hastbn \
|
+ 'hastbn: %s\n' % self.hastbn \
|
||||||
+ 'status: %s\n' % self.status
|
+ 'status: %s\n' % self.status
|
||||||
|
|
||||||
def create_meta_files(self, force=False):
|
def create_meta_files(self, force=False, save_ep=True):
|
||||||
|
# type: (bool, bool) -> None
|
||||||
|
"""
|
||||||
|
create meta data files for episode object
|
||||||
|
|
||||||
|
:param force: force writing of meta data files
|
||||||
|
:param save_ep: save changed episode data
|
||||||
|
"""
|
||||||
|
|
||||||
# noinspection PyProtectedMember
|
# noinspection PyProtectedMember
|
||||||
if not os.path.isdir(self.show_obj._location):
|
if not os.path.isdir(self.show_obj._location):
|
||||||
|
@ -4671,7 +4678,7 @@ class TVEpisode(TVEpisodeBase):
|
||||||
self.create_nfo(force)
|
self.create_nfo(force)
|
||||||
self.create_thumbnail()
|
self.create_thumbnail()
|
||||||
|
|
||||||
if self.check_for_meta_files():
|
if self.check_for_meta_files() and save_ep:
|
||||||
self.save_to_db()
|
self.save_to_db()
|
||||||
|
|
||||||
def create_nfo(self, force=False):
|
def create_nfo(self, force=False):
|
||||||
|
@ -5314,14 +5321,10 @@ class TVEpisode(TVEpisodeBase):
|
||||||
for cur_ep_obj in self.related_ep_obj:
|
for cur_ep_obj in self.related_ep_obj:
|
||||||
cur_ep_obj.location = absolute_proper_path + file_ext
|
cur_ep_obj.location = absolute_proper_path + file_ext
|
||||||
|
|
||||||
# in case something changed with the metadata just do a quick check
|
|
||||||
for cur_ep_obj in [self] + self.related_ep_obj:
|
|
||||||
cur_ep_obj.check_for_meta_files()
|
|
||||||
|
|
||||||
# save any changes to the database
|
# save any changes to the database
|
||||||
sql_l = []
|
sql_l = []
|
||||||
with self.lock:
|
for cur_ep_obj in [self] + self.related_ep_obj: # type: TVEpisode
|
||||||
for cur_ep_obj in [self] + self.related_ep_obj:
|
cur_ep_obj.create_meta_files(force=True, save_ep=False)
|
||||||
ep_sql = cur_ep_obj.get_sql()
|
ep_sql = cur_ep_obj.get_sql()
|
||||||
if None is not ep_sql:
|
if None is not ep_sql:
|
||||||
sql_l.append(ep_sql)
|
sql_l.append(ep_sql)
|
||||||
|
|
Loading…
Reference in a new issue