feat: add isNew func
This commit is contained in:
parent
de070a6ecf
commit
7e525e0c7e
20
bonus9.py
20
bonus9.py
@ -214,6 +214,24 @@ def music(userId, bonus_list):
|
|||||||
|
|
||||||
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
||||||
|
|
||||||
|
data = json.dumps({
|
||||||
|
"userId": int(userId),
|
||||||
|
"nextIndex": musicId,
|
||||||
|
"maxCount": 1
|
||||||
|
})
|
||||||
|
user_music = json.loads(sdgb_api(data, "GetUserMusicApi", userId))
|
||||||
|
|
||||||
|
isNew = "0"
|
||||||
|
try:
|
||||||
|
for item in user_music['userMusicList'][0]['userMusicDetailList']:
|
||||||
|
if item['musicId'] == musicId and item['level'] == level:
|
||||||
|
isNew = "1"
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# UserAll
|
# UserAll
|
||||||
|
|
||||||
data = json.dumps({
|
data = json.dumps({
|
||||||
@ -362,7 +380,7 @@ def music(userId, bonus_list):
|
|||||||
"isNewMapList": "",
|
"isNewMapList": "",
|
||||||
"isNewLoginBonusList": "0" * len(bonus_list),
|
"isNewLoginBonusList": "0" * len(bonus_list),
|
||||||
"isNewItemList": "",
|
"isNewItemList": "",
|
||||||
"isNewMusicDetailList": "1",
|
"isNewMusicDetailList": isNew,
|
||||||
"isNewCourseList": "0",
|
"isNewCourseList": "0",
|
||||||
"isNewFavoriteList": "",
|
"isNewFavoriteList": "",
|
||||||
"isNewFriendSeasonRankingList": ""
|
"isNewFriendSeasonRankingList": ""
|
||||||
|
|||||||
18
map_clear.py
18
map_clear.py
@ -214,7 +214,23 @@ def music(userId, mapId, distance, item_list, character_list, isNewMapList):
|
|||||||
|
|
||||||
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
||||||
|
|
||||||
|
data = json.dumps({
|
||||||
|
"userId": int(userId),
|
||||||
|
"nextIndex": musicId,
|
||||||
|
"maxCount": 1
|
||||||
|
})
|
||||||
|
user_music = json.loads(sdgb_api(data, "GetUserMusicApi", userId))
|
||||||
|
|
||||||
|
isNew = "0"
|
||||||
|
try:
|
||||||
|
for item in user_music['userMusicList'][0]['userMusicDetailList']:
|
||||||
|
if item['musicId'] == musicId and item['level'] == level:
|
||||||
|
isNew = "1"
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
# UserAll
|
# UserAll
|
||||||
@ -372,7 +388,7 @@ def music(userId, mapId, distance, item_list, character_list, isNewMapList):
|
|||||||
"isNewMapList": isNewMapList,
|
"isNewMapList": isNewMapList,
|
||||||
"isNewLoginBonusList": "",
|
"isNewLoginBonusList": "",
|
||||||
"isNewItemList": "1" * len(item_list),
|
"isNewItemList": "1" * len(item_list),
|
||||||
"isNewMusicDetailList": "1",
|
"isNewMusicDetailList": isNew,
|
||||||
"isNewCourseList": "0",
|
"isNewCourseList": "0",
|
||||||
"isNewFavoriteList": "",
|
"isNewFavoriteList": "",
|
||||||
"isNewFriendSeasonRankingList": ""
|
"isNewFriendSeasonRankingList": ""
|
||||||
|
|||||||
20
mapstock.py
20
mapstock.py
@ -6,12 +6,7 @@ import random
|
|||||||
from sdgb import sdgb_api
|
from sdgb import sdgb_api
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
from settings import music_data
|
from settings import music_data, regionId, regionName, clientId, placeId, placeName
|
||||||
from settings import regionId
|
|
||||||
from settings import regionName
|
|
||||||
from settings import clientId
|
|
||||||
from settings import placeId
|
|
||||||
from settings import placeName
|
|
||||||
|
|
||||||
from login import login
|
from login import login
|
||||||
from logout import logout
|
from logout import logout
|
||||||
@ -217,6 +212,17 @@ def music(userId):
|
|||||||
|
|
||||||
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
||||||
|
|
||||||
|
isNew = "0"
|
||||||
|
try:
|
||||||
|
for item in user_music['userMusicList'][0]['userMusicDetailList']:
|
||||||
|
if item['musicId'] == musicId and item['level'] == level:
|
||||||
|
isNew = "1"
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# UserAll
|
# UserAll
|
||||||
|
|
||||||
data = json.dumps({
|
data = json.dumps({
|
||||||
@ -365,7 +371,7 @@ def music(userId):
|
|||||||
"isNewMapList": "",
|
"isNewMapList": "",
|
||||||
"isNewLoginBonusList": "",
|
"isNewLoginBonusList": "",
|
||||||
"isNewItemList": "",
|
"isNewItemList": "",
|
||||||
"isNewMusicDetailList": "1",
|
"isNewMusicDetailList": isNew,
|
||||||
"isNewCourseList": "0",
|
"isNewCourseList": "0",
|
||||||
"isNewFavoriteList": "",
|
"isNewFavoriteList": "",
|
||||||
"isNewFriendSeasonRankingList": ""
|
"isNewFriendSeasonRankingList": ""
|
||||||
|
|||||||
19
music.py
19
music.py
@ -211,6 +211,23 @@ def music(userId, music_data):
|
|||||||
|
|
||||||
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
||||||
|
|
||||||
|
data = json.dumps({
|
||||||
|
"userId": int(userId),
|
||||||
|
"nextIndex": musicId,
|
||||||
|
"maxCount": 1
|
||||||
|
})
|
||||||
|
user_music = json.loads(sdgb_api(data, "GetUserMusicApi", userId))
|
||||||
|
|
||||||
|
isNew = "1"
|
||||||
|
try:
|
||||||
|
for item in user_music['userMusicList'][0]['userMusicDetailList']:
|
||||||
|
if item['musicId'] == musicId and item['level'] == level:
|
||||||
|
isNew = "0"
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# UserAll
|
# UserAll
|
||||||
|
|
||||||
@ -360,7 +377,7 @@ def music(userId, music_data):
|
|||||||
"isNewMapList": "",
|
"isNewMapList": "",
|
||||||
"isNewLoginBonusList": "",
|
"isNewLoginBonusList": "",
|
||||||
"isNewItemList": "",
|
"isNewItemList": "",
|
||||||
"isNewMusicDetailList": "0",
|
"isNewMusicDetailList": isNew,
|
||||||
"isNewCourseList": "0",
|
"isNewCourseList": "0",
|
||||||
"isNewFavoriteList": "",
|
"isNewFavoriteList": "",
|
||||||
"isNewFriendSeasonRankingList": ""
|
"isNewFriendSeasonRankingList": ""
|
||||||
|
|||||||
@ -506,6 +506,17 @@ def music(userId):
|
|||||||
|
|
||||||
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
user_charge = json.loads(sdgb_api(data, "GetUserChargeApi", userId))
|
||||||
|
|
||||||
|
isNew = "0"
|
||||||
|
try:
|
||||||
|
for item in user_music['userMusicList'][0]['userMusicDetailList']:
|
||||||
|
if item['musicId'] == musicId and item['level'] == level:
|
||||||
|
isNew = "1"
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
continue
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
# UserAll
|
# UserAll
|
||||||
|
|
||||||
data = json.dumps({
|
data = json.dumps({
|
||||||
@ -654,7 +665,7 @@ def music(userId):
|
|||||||
"isNewMapList": "",
|
"isNewMapList": "",
|
||||||
"isNewLoginBonusList": "",
|
"isNewLoginBonusList": "",
|
||||||
"isNewItemList": "1" * len(music_item()),
|
"isNewItemList": "1" * len(music_item()),
|
||||||
"isNewMusicDetailList": "1",
|
"isNewMusicDetailList": isNew,
|
||||||
"isNewCourseList": "0",
|
"isNewCourseList": "0",
|
||||||
"isNewFavoriteList": "",
|
"isNewFavoriteList": "",
|
||||||
"isNewFriendSeasonRankingList": ""
|
"isNewFriendSeasonRankingList": ""
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user