fiex 4 and 10, sorting csv's now and making sure the origin of duplication is always local instance if compared

This commit is contained in:
doctor_dev 2025-06-10 22:07:56 +00:00
parent 50f6a637cd
commit d78ed2bc86
No known key found for this signature in database
GPG key ID: F12F7F71CB84AEAA
5 changed files with 43 additions and 15 deletions

View file

@ -69,6 +69,8 @@ def clean_csv(df, blacklist):
try:
if not df.empty:
df = utils.sort_instances(df, 'Instance', conf.LOCAL_INSTANCE)
df = utils.remove_duplications(df)
df = df[~df.apply(lambda row: any(word in str(value) for word in blacklist for value in row), axis=1)]

View file

@ -15,10 +15,8 @@ def run_option_4():
utils.print_colors("4) Synchronize new links from new or existing webring participants, into your local csv files")
utils.print_colors('[+] Syncing official webrings to local webrings')
current_instance = utils.get_current_instance()
webring_df = utils.get_local_webring_participants(current_instance)
webring_df = utils.get_local_webring_participants(conf.LOCAL_INSTANCE)
utils.print_colors('[+] Reading local blacklist and sensitive words')
local_blacklist_df = utils.get_local_blacklist()
@ -27,13 +25,9 @@ def run_option_4():
utils.print_colors('[+] Reading local verified and unverified')
local_verified_df, local_unverified_df = utils.get_local_verified_and_unverified()
#Remove all rows
local_unverified_df = utils.renew_csv(local_unverified_df, current_instance)
local_verified_df = utils.renew_csv(local_verified_df, current_instance)
for participant in webring_df.itertuples(index=False, name='columns'):
# Check if the participant is my instance
if current_instance in participant:
if conf.LOCAL_INSTANCE in participant:
continue
if participant.Blacklisted == 'YES':