mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-11 23:18:22 +08:00
Add: Save and upload commission drop screenshots
This commit is contained in:
@@ -58,6 +58,10 @@ class AzurStats:
|
||||
def clear(self):
|
||||
self.images = []
|
||||
|
||||
@property
|
||||
def count(self):
|
||||
return len(self.images)
|
||||
|
||||
def _user_agent(self):
|
||||
return f'Alas ({self.config.AZURSTAT_ID})'
|
||||
|
||||
@@ -69,7 +73,7 @@ class AzurStats:
|
||||
amount = len(self.images)
|
||||
logger.info(f'Uploading screenshots to AzurStat, amount: {amount}')
|
||||
if amount == 0:
|
||||
logger.warning(f'Image upload failed, no images to upload')
|
||||
# logger.warning(f'Image upload failed, no images to upload')
|
||||
return False
|
||||
image = pack(self.images)
|
||||
output = io.BytesIO()
|
||||
|
||||
@@ -55,11 +55,13 @@ class Item:
|
||||
def name(self, value):
|
||||
"""
|
||||
Args:
|
||||
value (str): Item name, Camel-Case, such as 'PlateGeneralT3'. Suffix in name will be ignore.
|
||||
value (str): Item name, such as 'PlateGeneralT3'. Suffix in name will be ignore.
|
||||
For example, 'Javelin' and 'Javelin_2' are different templates, but have same output name 'Javelin'.
|
||||
"""
|
||||
if '_' in value:
|
||||
value = value.split('_')[0]
|
||||
pre, suffix = value.rsplit('_', 1)
|
||||
if suffix.isdigit():
|
||||
value = pre
|
||||
self._name = value
|
||||
|
||||
def __str__(self):
|
||||
|
||||
Reference in New Issue
Block a user