Page MenuHomePhabricator

Commonsfix for Mello 2018
Closed, ResolvedPublic2 Estimated Story Points

Description

Per request from the uploaders: Correct some mistakes in volunteer uploads of Community Support images from the Swedish Eurovision qualifies.

  • Rename all images in c:Category:Melodifestivalen_2018,_Göteborg from Melodifestivalen 2018, Deltävling <NUMBER>, Scandinavium, Göteborg, <NAME>.jpg to Melodifestivalen 2018, Deltävling 2, Scandinavium, Göteborg, <NAME> <NUMBER>.jpg

Event Timeline

  • Rename all images in c:Category:Melodifestivalen_2018,_Göteborg from Melodifestivalen 2018, Deltävling <NUMBER>, Scandinavium, Göteborg, <NAME>.jpg to Melodifestivalen 2018, Deltävling 2, Scandinavium, Göteborg, <NAME> <NUMBER>.jpg

For generating the new names the following was used (where the input api_data is the json available from here):

raw_data = api_data.get('query').get('categorymembers')

def rename(old):
    if 'Deltävling ' not in old:
        print('skip1: ', old)
        return
    elif 'Deltävling 2,' in old:
        print('skip2: ', old)
        return
    
    intro, _, outro = old.partition('Deltävling ')
    number, _, outro = outro.partition(',')
    ending, _, ext = outro.rpartition('.')
    return '{intro} Deltävling 2, {ending}, {number}.{ext}'.format(intro=intro.strip(), ending=ending.strip(), number=number.strip(), ext=ext)

def process_data(data):
    pairs = []
    for i in data:
        old_name = i.get('title')
        new_name = rename(old_name)
        if new_name:
            if new_name == old_name:
                print('skip3: ', old_name)
                continue
            pairs.append((old_name, new_name))
            print('Done: ', new_name)
    return pairs

Renaming started using pwb.py movepages -pairfile:... (under Lokal_Profil due to the movefile right)

For adding the templates the following should work:

  • python pwb.py add_text -cat:"Category:Melodifestivalen_2018,_Göteborg" -summary:"Adding the WMSE support template [[phab:T187500]]" -text:"{{Wmse-GemenskapensProjekt|project=Melodifestivalen 2018|travel=ja|press=ja|teknikpool=ja}}" -except:"\{\{([Tt]emplate:|)[Ww]mse-GemenskapensProjekt"
  • python pwb.py add_text -cat:"Category:Melodifestivalen_2018,_Karlstad" -summary:"Adding the WMSE support template [[phab:T187500]]" -text:"{{Wmse-GemenskapensProjekt|project=Melodifestivalen 2018|travel=ja|press=ja}}" -except:"\{\{([Tt]emplate:|)[Ww]mse-GemenskapensProjekt"

For adding the templates the following should work:

  • python pwb.py add_text -cat:"Category:Melodifestivalen_2018,_Göteborg" -summary:"Adding the WMSE support template T187500" -text:"{{Wmse-GemenskapensProjekt|project=Melodifestivalen 2018|travel=ja|press=ja|teknikpool=ja}}" -except:"\{\{([Tt]emplate:|)[Ww]mse-GemenskapensProjekt"
  • python pwb.py add_text -cat:"Category:Melodifestivalen_2018,_Karlstad" -summary:"Adding the WMSE support template [[phab:T187500]]" -text:"{{Wmse-GemenskapensProjekt|project=Melodifestivalen 2018|travel=ja|press=ja}}" -except:"\{\{([Tt]emplate:|)[Ww]mse-GemenskapensProjekt"

Started these under AndreCostaWMSE-bot

Lokal_Profil set the point value for this task to 2.Feb 16 2018, 3:25 PM
AxelPettersson_WMSE removed the point value for this task.

python pwb.py add_text -cat:"Category:Prince_William_and_Duchess_Kate_of_Cambridge_visits_Sweden" -summary:"Adding the WMSE support template [[phab:T187500]]" -text:"{{Wmse-GemenskapensProjekt|press=ja}}" -except:"\{\{([Tt]emplate:|)[Ww]mse-GemenskapensProjekt"

Edit: Had to clean up the non-Janwikifoto images afterwards :(

Lokal_Profil moved this task from 📥 Backlog to ☑️ Done on the User-LokalProfil board.
Lokal_Profil set the point value for this task to 2.
Lokal_Profil moved this task from Backlog to Done on the WMSE-Community-Support-2018 board.