Skip to content

Commit

Permalink
fix usp image receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
baskiton committed Jul 17, 2024
1 parent d0262f4 commit 77a3134
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions SatsDecoder/systems/usp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,10 +1480,10 @@ class UspImageReceiver(ImageReceiver):
def __init__(self, outdir):
super().__init__(outdir)

def generate_fid(self, fname=''):
def generate_fid(self, fname='', force=0):
if self.current_fid.startswith('unknown_') and fname:
self.rename_image(self.current_fid, fname)
elif not (self.current_fid and self.merge_mode):
elif force or not (self.current_fid and self.merge_mode):
self.last_date = now = dt.datetime.now()
if not fname:
fname = f'unknown_{now.strftime("%Y-%m-%d_%H-%M-%S,%f")}'
Expand All @@ -1503,7 +1503,7 @@ def push_data(self, data, **kw):
img.first_data_offset = packet.offset

elif data.message == FILETRANSFER_INIT:
self.generate_fid(packet.file_name)
self.generate_fid(packet.file_name, 1)
img = self.get_image()
with img.lock:
img.has_starter = 1
Expand Down

0 comments on commit 77a3134

Please sign in to comment.