Skip to content

Commit

Permalink
Move Redundant Clear Operations into Init
Browse files Browse the repository at this point in the history
E303
  • Loading branch information
diamondpete committed Sep 23, 2023
1 parent 09cae8e commit 5fa7b89
Show file tree
Hide file tree
Showing 193 changed files with 8 additions and 413 deletions.
8 changes: 8 additions & 0 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,18 @@ def update(self, metadata, media, lang):

HTTP.ClearCache()
metadata.collections.clear()

metadata.genres.clear()
movieGenres.clearGenres()

metadata.roles.clear()
movieActors.clearActors()

metadata.directors.clear()
movieActors.clearDirectors()

metadata.producers.clear()
movieActors.clearProducers()

Log('******UPDATE CALLED*******')

Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/addActors.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in sceneGenres.split(','):
genreName = genreLink.strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in sceneActors.split(','):
actorName = actorLink.strip()
actorPhotoURL = ''
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/network18.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in PAutils.getDictValuesFromKey(genresDB, PAsearchSites.getSearchSiteName(siteNum)):
genreName = genreLink.strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements['talent']:
actorPhoto = []
actorName = actorLink['talent']['name']
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/network1service.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,13 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
genres = detailsPageElements['tags']
for genreLink in genres:
genreName = genreLink['name']

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
actors = detailsPageElements['actors']
for actorLink in actors:
actorPageURL = PAsearchSites.getSearchSearchURL(siteNum) + '/v1/actors?id=%d' % actorLink['id']
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/network5Kporn.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()

# Actor(s)
movieActors.clearActors()
actors = detailsPageElements.xpath('//h5[contains(., "Starring")]/a')
for actorLink in actors:
actorName = actorLink.text_content().strip()
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkAbbyWinters.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//aside/div[contains(@class, "description")]//a'):
genreName = genreLink.text_content().strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//tr[contains(., "Scene")]//a'):
actorName = actorLink.text_content().strip()
actorPhotoURL = ''
Expand Down
3 changes: 0 additions & 3 deletions Contents/Code/networkAdultEmpireCash.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreName in detailsPageElements.xpath('//div[@class="tags"]//a/text()'):
movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//div[@class="video-performer"]//img'):
actorName = actorLink.get('title')
actorPhotoURL = actorLink.get('data-bgsrc')
Expand All @@ -103,7 +101,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
movieActors.addActor('Rhea Radford', '')

# Director
movieActors.clearDirectors()
directorElement = detailsPageElements.xpath('//div[@class="director"]/text()')
if directorElement:
directorName = directorElement[0].strip()
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkAdultPrime.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//p[@class="update-info-line regular"][./b[contains(., "Niches")]]')[0].text_content().split(':')[-1].split(','):
genreName = PAutils.parseTitle(genreLink.strip(), siteNum)

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
actors = detailsPageElements.xpath('//p[@class="update-info-line regular"][./b[contains(., "Performer")]]/a')
for actorLink in actors:
actorName = actorLink.text_content().strip()
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkAuntJudys.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//span[@class="update_tags"]/a'):
genreName = PAutils.parseTitle(genreLink.text_content().strip(), siteNum)

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
actors = detailsPageElements.xpath('//p/span[@class="update_models"]/a')
for actorLink in actors:
actorName = actorLink.text_content().strip()
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkBadoinkVR.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//a[@class="video-tag"]'):
genreName = genreLink.text_content().strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//a[contains(@class, "video-actor-link")]'):
actorName = actorLink.text_content().strip()

Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkBang.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Actor(s)
movieActors.clearActors()
if siteNum == 1365:
actorXPATH = '//div[contains(@class, "clear-both")]//a[contains(@href, "pornstar")]'
else:
Expand All @@ -143,7 +142,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
movieActors.addActor(actorName, actorPhotoURL)

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//div[@class="actions"]/a | //a[@class="genres"]'):
genreName = genreLink.text_content()

Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkBangBrosOther.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
genres = detailsPageElements.xpath('//*[.//@class="fa fa-tag"]/text()')
for genreLink in genres:
genreName = genreLink.strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//*[.//@class="fa fa-star"]/text()'):
actorName = actorLink.strip()
actorPhotoURL = ''
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkBellaPass.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.collections.add(tagline)

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//div[contains(@class, "featuring")]//a[contains(@href, "/categories/")]'):
genreName = genreLink.text_content().strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
actors = detailsPageElements.xpath('//div[contains(@class, "featuring")]//a[contains(@href, "/models/")]')
if actors:
if len(actors) == 3:
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkBlurredMedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//a[@class="video__tag"]'):
genreName = genreLink.text_content().strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//section[@name="modelsBio"]/article/figure'):
actorName = actorLink.xpath('.//p/a')[0].text_content().strip()
actorPhotoURL = actorLink.xpath('.//img//@src')[0]
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkCherryPimps.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//div[@class="info-block"]//a | //ul[@class="tags"]//a'):
genreName = genreLink.text_content().strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
actors = detailsPageElements.xpath('//div[@class="info-block_data"]//a | //div[contains(@class, "model-list-item")]//a')
if actors:
if len(actors) == 3:
Expand Down
4 changes: 0 additions & 4 deletions Contents/Code/networkCouplesCinema.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,7 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
year = detailsPageElements.xpath('//span[contains(@class, "type")]')[0].text_content().split('|')[1].strip()
metadata.year = int(year)

# Genres
movieGenres.clearGenres()

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//div[contains(@class, "cast")]/a'):
actorName = actorLink.text_content().strip()
actorPhotoURL = ''
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkCzechAV.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//ul[@class="tags"]/li'):
genreName = genreLink.text_content().strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
if siteNum == 1583:
actorName = '%s %s' % (title, detailsPageElements.xpath('//span[@class="age"]')[0].text_content().strip())
movieActors.addActor(actorName, detailsPageElements.xpath('//div[contains(@class, "gallery")]//@href')[0])
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkCzechVR.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//div[@class="tag"]//a'):
genreName = genreLink.text_content().lower().strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('(//div[contains(@class, "nazev")])[1]//div[@class="featuring"]//a'):
actorName = actorLink.text_content().strip()
actorPhotoURL = ''
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkDerangedDollars.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//p[@class="tags"]/a'):
genreName = PAutils.parseTitle(genreLink.text_content().strip(), siteNum)

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
actors = detailsPageElements.xpath('//div[@class="lch"]/span')[0].text_content().rsplit(',', 2)[0]
if ':' in actors:
actors = re.split(',|&|/|And', actors.split(':', 1)[1])
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkDirtyFlix.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,11 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
genres = PAutils.getDictValuesFromKey(genresDB, PAsearchSites.getSearchSiteName(siteNum))
for genreName in genres:
movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
actors = PAutils.getDictKeyFromValues(sceneActorsDB, sceneID)
for actor in actors:
actorName = actor.strip()
Expand Down
1 change: 0 additions & 1 deletion Contents/Code/networkDirtyHardDrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.collections.add(tagline)

# Actor(s)
movieActors.clearActors()
actorLink = detailsPageElements.xpath('//div[@id="video-specs"]//span')
if actorLink:
actorName = actorLink[-1].text_content().strip()
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkEvolvedFights.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.collections.add(metadata.studio)

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//span[(contains(@class, "tour_update_tags"))]/a'):
genreName = genreLink.text_content().strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//div[(contains(@class, "update_block_info model_update_block_info"))]/span[(contains(@class, "tour_update_models"))]/a'):
actorName = actorLink.text_content().strip()
actorPageURL = actorLink.get('href')
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkFAKings.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.collections.add(tagline)

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//strong[contains(., "Categori")]//following-sibling::a'):
genreName = genreLink.text_content().strip()

Expand All @@ -98,7 +97,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
img = ''

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//strong[contains(., "Actr")]//following-sibling::a'):
actorName = actorLink.text_content().strip()

Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkFTV.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
genres = []
if tagline == 'FTVGirls':
genres = ['Teen', 'Solo', 'Public']
Expand All @@ -87,7 +86,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
actors = []

for idx, actorLink in enumerate(detailsPageElements.xpath('//div[@id="ModelDescription"]//h1')):
Expand Down
1 change: 0 additions & 1 deletion Contents/Code/networkFemdomEmpire.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
movieGenres.addGenre('Femdom')

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//div[contains(@class, "featuring")][1]/ul/li'):
actorName = actorLink.text_content().strip().replace('Featuring:', '')
actorPhotoURL = ''
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkFuelVirtual.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//td[@class="plaintext"]/a[@class="model_category_link"]'):
genreName = genreLink.text_content().strip()

Expand All @@ -66,7 +65,6 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
movieGenres.addGenre('18-Year-Old')

# Actor(s)
movieActors.clearActors()
actors = detailsPageElements.xpath('//div[@id="description"]//td[@align="left"]/a')
if actors:
if len(actors) == 3:
Expand Down
2 changes: 0 additions & 2 deletions Contents/Code/networkFullPornNetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,12 @@ def update(metadata, lang, siteNum, movieGenres, movieActors, art):
metadata.year = metadata.originally_available_at.year

# Genres
movieGenres.clearGenres()
for genreLink in detailsPageElements.xpath('//div[contains(@class, "video-info")]//a[contains(@href, "/categories/")]/text()'):
genreName = genreLink.strip()

movieGenres.addGenre(genreName)

# Actor(s)
movieActors.clearActors()
for actorLink in detailsPageElements.xpath('//div[contains(@class, "video-info")]//a[contains(@href, "/models/")]'):
actorName = actorLink.text_content().strip()
actorLink = actorLink.xpath('./@href')[0].strip()
Expand Down
Loading

0 comments on commit 5fa7b89

Please sign in to comment.