mirror of
https://gitlab.com/bashrc2/epicyon
synced 2026-11-03 03:02:13 +00:00
Use hashes in item ID
This commit is contained in:
1 parent
13443a914d
commit
303687ba58
2 files changed
+4
-3
No files matched your search
@@ -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,
|
||||
|
||||
+2
-1
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user