Skip to content

Commit

Permalink
add link to media and fix db media updte
Browse files Browse the repository at this point in the history
  • Loading branch information
datawhores committed Sep 18, 2024
1 parent 72e2474 commit 35d5dd4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ async def process_dicts(username, model_id, medialist, posts):
return log_text_array, (0, 0, 0, 0, 0)
task1 = None
with progress_utils.setup_download_progress_live(multi=False):
log = logging.getLogger("shared")
try:

aws = []
Expand Down
6 changes: 4 additions & 2 deletions ofscraper/classes/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,10 @@ def preview(self):

@property
def linked(self):
return (self.url or self.mpd)!=None

return (self.url or self.mpd)is not None
@property
def link(self):
return self.url or self.mpd
@property
def media(self):
return self._media
Expand Down
7 changes: 4 additions & 3 deletions ofscraper/db/operations_/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def write_media_table_via_api_batch(medias, model_id=None, conn=None, **kwargs)
lambda media: [
media.id,
media.postid,
media.url or media.mpd,
media.link,
media.responsetype.capitalize(),
media.mediatype.capitalize(),
media.preview,
Expand Down Expand Up @@ -447,7 +447,7 @@ def update_media_table_via_api_batch(
lambda media: [
media.id,
media.postid,
media.url or media.mpd,
media.link,
media.linked,
media.responsetype.capitalize(),
media.mediatype.capitalize(),
Expand Down Expand Up @@ -657,7 +657,8 @@ def update_media_table_via_api_helper(
insertData = [
media.id,
media.postid,
media.url or media.mpd,
media.link,
media.linked,
media.responsetype.capitalize(),
media.mediatype.capitalize(),
media.preview,
Expand Down

0 comments on commit 35d5dd4

Please sign in to comment.