Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String pfold[] = {"", " (ja)", "(ja)"};
- String pfnew[] = {"", " (ja)", " (ja)"};
- int raold[] = {1,309,309};
- int ranew[] = {580,333,333};
- for (int p = 0; p < 3; p++) {
- for (int i = raold[p]; i <=ranew[p]; i++) {
- String oldFileName = "Episode"+String.Format("{0:000}",i)+pfold[p];
- String newFileName = "Episode "+String.Format("{0:000}",i)+pfnew[p];
- //Dateien umbenennen
- //Episodenbilder
- Page p = new Page(site,"Datei:"+oldFileName+".jpg");
- p.Load(); if(p.Exists()) p.RenameTo("Datei:"+newFileName+".jpg",reason);
- //NextHints
- p = new Page(site,"Datei:"+oldFileName+"-Hint.jpg");
- p.Load(); if(p.Exists()) p.RenameTo("Datei:"+newFileName+"-Hint.jpg",reason);
- //Diashows
- int maxj = 0;
- for (int j = 1; j <= 20; j++) {
- p = new Page(site,"Datei:"+oldFileName+"-"+j.ToString()+".jpg");
- p.Load(); if(p.Exists()) p.RenameTo("Datei:"+newFileName+"-"+j.ToString()+".jpg",reason); else { maxj = j-1; break; }
- }
- //Verlinkungen auf allen Seiten korrigieren
- PageList pl = new PageList(site);
- pl.FillFromPagesUsingImage(oldFileName+".jpg");
- pl.FillFromPagesUsingImage(oldFileName+"-Hint.jpg");
- for (int j = 1; j <= maxj; j++) {
- pl.FillFromPagesUsingImage(oldFileName+"-"+j.ToString()+".jpg");
- }
- pl.RemoveRecurring();
- foreach(Page page in pl) {
- page.Load();
- page.text = page.text.Replace(oldFileName+".jpg",newFileName+".jpg");
- page.text = page.text.Replace(oldFileName+"-Hint.jpg",newFileName+"-Hint.jpg");
- for (int j = 1; j <= maxj; j++) {
- page.text = page.text.Replace(oldFileName+"-"+j.ToString()+".jpg",newFileName+"-"+j.ToString()+".jpg");
- }
- page.Save(reason,true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement