Finish implementing ignoring users that were already suggested.
The ability to remember users that were suggested was there, but it was missing the part about skipping those users.main
parent
3fcfdb95d5
commit
87d1b74cba
|
@ -63,6 +63,9 @@ parser = ArgumentParser(
|
|||
epilog="https://git.chuso.net/chuso/mastoroulette")
|
||||
parser.add_argument("-u", "--update-cache",
|
||||
action="store_true", help="Update the cache")
|
||||
parser.add_argument("-i", "--ignore-repeats",
|
||||
action="store_true",
|
||||
help="Allows suggesting users that were already suggested in the past")
|
||||
args = parser.parse_args()
|
||||
|
||||
# A forced update was not requested
|
||||
|
@ -98,6 +101,11 @@ for f in followers:
|
|||
# We use the `uri` field to compare users because that field is assumed to be unique
|
||||
if [u for u in followings if u["uri"] == f["uri"]]:
|
||||
continue
|
||||
# For users that were already suggested, we check the id which is assumed
|
||||
# to be immutable (but instance-specific) as opposed to uri that can change
|
||||
# if the user migrated to a differnt instance
|
||||
if not args.ignore_repeats and f["id"] not in suggested:
|
||||
continue
|
||||
|
||||
print(f["url"])
|
||||
|
||||
|
|
Loading…
Reference in New Issue