Esempio n. 1
0
 def add_stars(self, stars, Obj):
     for star in stars:
         StarObj = if_star_exist(AddStarViaDir(set_dir_for_star(star)), star)
         Obj.stars.append(StarObj)
         if hasattr(self, 'data'):
             StarObj.movies.append(self.data)
         session.commit()
Esempio n. 2
0
 def add_item(item):
     if 'data' in item:
         item['value'] = datetime(
             item['value'][0],
             item['value'][1],
             item['value'][2]
         )
     setattr(Obj, item['db'], item['value'])
     session.commit()
Esempio n. 3
0
 def add_tags(self, tags, Obj=None):
     if Obj is not None:
         self.data = Obj
     for tag in tags:
         query = session.query(Tags).filter(Tags.name == tag).first()
         if query is None:
             TagObj = Tags(name=tag.replace(",", "").replace(" ", "").capitalize())
             session.add_all([TagObj])
             session.commit()
             query = TagObj
         self.data.tags.append(query)
         session.commit()
Esempio n. 4
0
 def add_series_list(self, series, Obj):
     for serie in series:
         ASVD = AddSeriesViaDir(set_dir_for_star(serie))
         SeriesObj = ASVD.if_series_exist(ASVD.name)
         Obj.series.append(SeriesObj)
         session.commit()
Esempio n. 5
0
 def add_star_to_series(Star, Series):
     Series.stars.append(Star)
     session.commit()
Esempio n. 6
0
 def up_date_views(self):
     if self.data is not None:
         self.data.views = self.data.views + 1
         session.commit()