mirror of https://gitlab.com/bashrc2/epicyon
Use hashes in item ID
parent
13443a914d
commit
303687ba58
|
@ -83,7 +83,7 @@ def getValidSharedItemID(actor: str, displayName: str) -> str:
|
|||
"""Removes any invalid characters from the display name to
|
||||
produce an item ID
|
||||
"""
|
||||
removeChars = (' ', '\n', '\r')
|
||||
removeChars = (' ', '\n', '\r', '#')
|
||||
for ch in removeChars:
|
||||
displayName = displayName.replace(ch, '')
|
||||
removeChars2 = ('+', '/', '\\', '?', '&')
|
||||
|
@ -91,7 +91,7 @@ def getValidSharedItemID(actor: str, displayName: str) -> str:
|
|||
displayName = displayName.replace(ch, '-')
|
||||
displayName = displayName.replace('.', '_')
|
||||
displayName = displayName.replace("’", "'")
|
||||
return actor + '/shareditems/' + displayName
|
||||
return actor.replace('/', '#') + '#shareditems#' + displayName
|
||||
|
||||
|
||||
def removeSharedItem(baseDir: str, nickname: str, domain: str,
|
||||
|
|
|
@ -381,7 +381,8 @@ def sharesTimelineJson(actor: str, pageNumber: int, itemsPerPage: int,
|
|||
ctr = 0
|
||||
for itemID, item in sharesJson.items():
|
||||
# assign owner to the item
|
||||
item['actor'] = itemID.split('/shareditems/')[0]
|
||||
item['actor'] = \
|
||||
itemID.split('#shareditems#')[0].replace('#', '/')
|
||||
allSharesJson[str(item['published'])] = item
|
||||
ctr += 1
|
||||
if ctr >= maxSharesPerAccount:
|
||||
|
|
Loading…
Reference in New Issue