public
Last active

Zotfile key files changed for photo workflow

  • Download Gist
overlay.xul
XML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://zotfile/skin/overlay.css" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://zotfile/locale/zotfile.dtd">
 
<overlay id="zotfile-overlay"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<stringbundleset id="stringbundleset">
<stringbundle id="zotfile-strings"
src="chrome://zotfile/locale/zotfile.properties"/>
</stringbundleset>
<!-- ZotFile context menus -->
<popup id="zotero-itemmenu">
<menuseparator />
<menuitem label="Attach New File" tooltiptext="Move and attach last file in user defined folder to selected Zotero item" oncommand="Zotero.ZotFile.AttachNewFile()"/>
<menuitem label="Attach Converted File" tooltiptext="Attach a converted version of the last file in a user-defined folder to this item" oncommand="Zotero.ZotFile.AttachConvertedFile()"/>
<menuitem label="Rename Existing Attachments" tooltiptext="Move and rename existing Attachments from selected Zotero item" oncommand="Zotero.ZotFile.RenameAttachments()"/>
</popup>
<!-- Include the main extension logic -->
<script src="chrome://zotero/content/include.js"/>
<script src="chrome://zotfile/content/include.js"/>
</overlay>
process.bat
Batchfile
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
@echo off
REM For processing captured images from JPG to PBM to DjVu.
REM Takes one argument-- the input without the extension
REM Exits with value of 200 if all is well.
 
:: Set library executables
set magick="c:\Documents and Settings\Avram\My Documents\ImageMagick-6.6.6-3\convert.exe"
set djvu="c:\Program Files\minidjvu\minidjvu.exe"
 
IF NOT EXIST %1%.JPG (
echo Input file not found: %1.JPG
pause
GOTO :EOF
) else (
echo Processing %1.JPG
)
 
:CONVERSIONS
:: First use ImageMagick to make a PBM
echo Converting to PBM
%magick% %1.JPG %1.pbm
IF NOT EXIST %1.pbm (
echo Converted PBM not found.
pause
GOTO :EOF
)
:: Now use the DjVu utility to make a DjVu
echo Converting to DjVu
:: Now convert it to DjVu
%djvu% %1.pbm %1.djvu
IF NOT EXIST %1.djvu (
echo Converted DjVu not found.
pause
GOTO :EOF
) ELSE (
:: Delete the PBM, now that we have the DjVu
del %1.pbm
EXIT 200
)
zotfile.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571
Zotero.ZotFile = {
 
prefs: null,
fileMap: {}, //maps collections to their file objects
 
mergeObserver: {
observe: function(a, b, c){
//this should get called when the dynamic overlay loading in createUI is complete.
//we adjust UI stuff according to preferences here.
document.getElementById("zotfile-usetags").setAttribute("checked",
Zotero.ZotFile.prefs.getBoolPref("useTags").toString());
}
},
 
createUI: function() {
// Coment from lytero "I can't reference the node where I want to add stuff directly in an overlay because it has no ID,
// so I'll create the minimum here and dynamically load the overlay."
// var lmenu = document.createElement("toolbarbutton");
// lmenu.setAttribute("id", "overlay");
// var parentn = document.getElementById("zotero-collections-pane").firstChild.firstChild;
// parentn = document.getElementById("zotero-items-pane").firstChild;
// var zfb = document.createElement("toolbarbutton");
// zfb.setAttribute("id", "zf-button");
// siblingn = document.getElementById("zotero-tb-advanced-search");
// add the button to start action
// parentn.insertBefore(zfb, siblingn);
// parentn.insertBefore(document.createElement("toolbarseparator"),siblingn);
 
//load the overlay
document.loadOverlay("chrome://zotfile/content/overlay.xul", this.mergeObserver);
},
getpara: function (para) {
// Initially this function
var filetypes=/pdf|doc|txt|rtf|jpg|JPG/;
if(para=="filetypes") return(filetypes);
},
 
 
init: function () {
//set up preferences
this.prefs = Components.classes["@mozilla.org/preferences-service;1"].
getService(Components.interfaces.nsIPrefService);
this.prefs = this.prefs.getBranch("extensions.zotfile.");
// this.wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
// getService(Components.interfaces.nsIWindowMediator);
this.createUI()
},
infoWindow: function(main, message, time){
 
var pw = new (Zotero.ProgressWindow);
pw.changeHeadline(main);
if (main=="error") pw.changeHeadline(Zotero.getString("general.errorHasOccurred")); pw.addDescription(message);
pw.show();
pw.startCloseTimer(time);
 
},
// Function replaces wildcard both for filename and subfolder definition
replaceWildcard: function(zitem, rule){
// get item type
var item_type = zitem.getType();
// get title of selected item
var title = zitem.getField('title');
 
// truncnate title after : . and ?
var truncate = title.search(/:|\.|\?/);
if(truncate!=-1) var title = title.substr(0,truncate);
var title_length = title.length;
if (title_length>this.prefs.getIntPref("max_titlelength")) var title = title.substr(0,this.prefs.getIntPref("max_titlelength"));
 
// get journal
var journal = zitem.getField('publicationTitle');
 
// get journal abbreviation
var journal_abb = zitem.getField('journalAbbreviation');
 
// get publisher
var publisher = zitem.getField('publisher');
 
// get volume and issue
var volume = zitem.getField('volume');
var issue = zitem.getField('issue');
 
// get patent stuff
// var inventor
var assignee = zitem.getField('assignee');
var patentnr = zitem.getField('patentNumber');
var priority_date = patentnr.substr(2,4);
 
// get creator and create authors string
var creatorType=1;
if (zitem.getType()==19) var creatorType=14;
var add_etal=this.prefs.getBoolPref("add_etal");
var author = "";
var creators = zitem.getCreators();
var numauthors = creators.length;
for (var i=0; i < creators.length; i++) {
if(creators[i].creatorTypeID!=creatorType) var numauthors=numauthors-1;
}
if (numauthors<=this.prefs.getIntPref("max_authors")) var add_etal=0;
if (numauthors>this.prefs.getIntPref("max_authors")) var numauthors = 1;
var j=0;
for (var i=0; i < creators.length; i++) {
if (j<numauthors & creators[i].creatorTypeID==creatorType) {
if (author!="") var author = author + "_" + creators[i].ref.lastName;
if (author=="") var author = creators[i].ref.lastName;
var j=j+1;
}
}
if (add_etal==1) var author = author + this.prefs.getCharPref("etal");
 
// date
var year = zitem.getField('date', true).substr(0,4);
if(item_type==19) var year_issue = zitem.getField('issueDate', true).substr(0,4);
 
// create output from rule
var field=0;
var output='';
for (var i=0; i<rule.length; i++) {
var char=rule.charAt(i);
switch (char) {
case '%':
var field=1;
break;
 
case 'a':
if (field==1) var output = output + author;
var field=0;
break;
 
case 't':
if (field==1) var output = output + title;
var field=0;
break;
 
case 'y':
if (field==1) var output = output + year;
var field=0;
break;
 
case 'j':
if (field==1) var output = output + journal;
var field=0;
break;
 
case 'p':
if (field==1) var output = output + publisher;
var field=0;
break;
 
case 'n':
if (field==1) var output = output + patentnr;
var field=0;
break;
 
case 'i':
if (field==1) var output = output + assignee;
var field=0;
break;
 
case 'u':
if (field==1) var output = output + year_issue;
var field=0;
break;
 
case 'w':
if (field==1) {
var output = output + journal;
if(journal=="") var output = output + publisher;
}
var field=0;
break;
 
case 's':
if (field==1) var output = output + journal_abb;
var field=0;
break;
 
case 'v':
if (field==1) var output = output + volume;
var field=0;
break;
 
case 'e':
if (field==1) var output = output + issue;
var field=0;
break;
 
default: var output = output + char;
}
}
return(output);
},
getFolder: function(zitem, dest_dir, rule){
var subfolder="";
if( this.prefs.getBoolPref("subfolder")) {
subfolder=this.replaceWildcard(zitem, rule);
}
// var journal = zitem.getField('publicationTitle');
var folder = dest_dir + subfolder;
return(folder);
},
// pref("extensions.zotfile.subfolder", false);
// pref("extensions.zotfile.subfolderFormat", "%j/%y");
getFiletype: function(fname){
var temp = new Array();
temp = fname.split('.');
return(temp[temp.length-1].toLowerCase());
},
 
lastFileInDir: function(dir_path, rule){
// create a nslFile Object for the dir
try {
var dir = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
dir.initWithPath(dir_path);
var lastfile_date=0;
var lastfile_path="";
var success=0;
// go through all the files in the dir
var i=0;
var files = dir.directoryEntries;
while (files.hasMoreElements()) {
// get one after the other file
var file = files.getNext();
file.QueryInterface(Components.interfaces.nsIFile);
// only look at files which are neither folders nor hidden
if(!file.isDirectory() & !file.isHidden()) {
// now we want to check which filetype we are looking at
// we only want to consider pdfs, docs, ...
var filetype=this.getFiletype(file.leafName);
// for whatever reason, rule is not really passed to the function so I just call getpara directly in the line above...
var type=filetype.search(this.getpara("filetypes"));
if (type>=0) {
var modtime = file.lastModifiedTime;
var i=i+1;
// finally, we set lastfile to the file with the most recent modification
if (modtime>lastfile_date){
var lastfile_date=modtime;
lastfile=file;
var success=1;
}
}
}
}
if (success==1) return(lastfile);
else return(-1);
 
} catch (e) {
Components.utils.reportError(e);
return (-2);
}
},
 
moveFile: function(file, destination, filename){
// create a nslFile Object of the destination folder
var dir = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
dir.initWithPath(destination);
// move file to new location
file.moveTo(dir, filename);
return(file.path);
},
 
convertFile: function(file, destination, filename) {
// create a nslFile Object of the destination folder
var dir = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
dir.initWithPath(destination);
// move file to new location
file.moveTo(dir, filename);
var status = this.convertFileFromPath(file.path);
if(status == 200) {
var djpath = file.path.replace(/\.\w+$/, ".djvu");
this.infoWindow("Zotfile Report","File \'" + file.path + "\' was successfully converted to DejaVu format.",8000);
return(djpath);
} else {
this.infoWindow("Zotfile Report","File \'" + file.path + "\' was not converted to DejaVu format. It will be added without being changed"+"Status: "+status,8000);
return(file.path);
}
},
 
convertFileFromPath: function(filePath) {
// create an nsILocalFile for the executable
var processor = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile);
processor.initWithPath(this.prefs.getCharPref("converterPath"));
//processor.initWithPath("c:\\Documents and Settings\\Avram\\My Documents\\Academic Large Documents\\Tethered Shooting\\process.bat");
if (!processor.exists()) {
this.infoWindow("Zotfile Error","Conversion script not found at path "+this.prefs.getCharPref("converterPath"),8000);
return 0;
}
 
// create an nsIProcess
var process = Components.classes["@mozilla.org/process/util;1"]
.createInstance(Components.interfaces.nsIProcess);
process.init(processor);
 
// Run the process.
// If first param is true, calling thread will be blocked until
// called process terminates.
// Second and third params are used to pass command-line arguments
// to the process.
var args = [filePath.match(/(.*)\.\w+$/)[1]];
process.run(true, args, args.length);
return(process.exitValue);
},
getFilename: function(item){
// create the new filename from the selected item
var item_type = item.getType();
var rename_rule=this.prefs.getCharPref("renameFormat");
if(item_type==19) var rename_rule=this.prefs.getCharPref("renameFormat_patent");
if (!this.prefs.getBoolPref("useZoteroToRename")) {
var filename=this.replaceWildcard(item, rename_rule);
//var filename = author + "_" + year + "_" + title;
 
// Strip potentially invalid characters
// (code line adopted from Zotero)
var filename = filename.replace(/[\/\\\?\*:|"<>\.]/g, '');
 
// replace blanks with '_' if option selected
if (this.prefs.getBoolPref("replace_blanks")) var filename = filename.replace(/ /g, '_');
}
if (this.prefs.getBoolPref("useZoteroToRename")) filename=Zotero.Attachments.getFileBaseNameFromItem(item.itemID);
return(filename);
},
// Attach Converted Copy of File from Download Folder
// This code is just copied from the subsequent function
AttachConvertedFile: function(){
var items = ZoteroPane.getSelectedItems();
var item = items[0];
//check whether it really is an bibliographic item (no Attachment, note or collection)
if (!item.isAttachment() & !item.isCollection() & !item.isNote()) {
// create the new filename from the selected item
filename=this.getFilename(item);
// get the last modified file from a directory
file=this.lastFileInDir(this.prefs.getCharPref("source_dir"), this.getpara("filetypes"));
if(file!=-1 & file!=-2 ) {
var file_oldpath=file.leafName;
 
// complete filename with extension
var filetype=this.getFiletype(file.leafName);
var filename = filename + "." + filetype;
// confirmation from user
var confirmed=1;
if (this.prefs.getBoolPref("confirmation")) var confirmed=confirm("Do you want to rename and link the file \'" + file_oldpath + "\' to the currently selected Zotero item?");
if(confirmed){
// set location for renamed file
if (!this.prefs.getBoolPref("import")) var location=this.getFolder(item,this.prefs.getCharPref("dest_dir"),this.prefs.getCharPref("subfolderFormat"));
if ( this.prefs.getBoolPref("import")) var location=this.prefs.getCharPref("dest_dir");
 
// convert file
var file_path=this.convertFile(file, location, filename);
// recreate the file nslFile Object
// (for some reason the Attachment is linked to the wrong location without recreation)
var file = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(file_path);
// Linked Attachments
if (!this.prefs.getBoolPref("import")) Zotero.Attachments.linkFromFile(file, item.itemID,item.libraryID);
 
// Imported Attachments - Attach last file to selected Zotero item
if(this.prefs.getBoolPref("import")) {
// Attach last file to selected Zotero item
Zotero.Attachments.importFromFile(file, item.itemID,item.libraryID);
//Delete the old file that is not longer needed
file.remove(false);
}
 
// Show message
this.infoWindow("Zotfile Report","File \'" + file_oldpath + "\' changed to \'" + file.leafName + "\' and added as an attachment.",8000);
}
}
else this.infoWindow("Zotfile Error","Unable to find file in " + this.prefs.getCharPref("source_dir"),8000);
}
else this.infoWindow("Zotfile Error","Selected item is either an Attachment, a note, or a collection.",8000);
},
 
// Attach New File from Download Folder
AttachNewFile: function(){
var items = ZoteroPane.getSelectedItems();
var item = items[0];
//check whether it really is an bibliographic item (no Attachment, note or collection)
if (!item.isAttachment() & !item.isCollection() & !item.isNote()) {
// create the new filename from the selected item
filename=this.getFilename(item);
// get the last modified file from a directory
file=this.lastFileInDir(this.prefs.getCharPref("source_dir"), this.getpara("filetypes"));
if(file!=-1 & file!=-2 ) {
var file_oldpath=file.leafName;
 
// complete filename with extension
var filetype=this.getFiletype(file.leafName);
var filename = filename + "." + filetype;
// confirmation from user
var confirmed=1;
if (this.prefs.getBoolPref("confirmation")) var confirmed=confirm("Do you want to rename and link the file \'" + file_oldpath + "\' to the currently selected Zotero item?");
if(confirmed){
// set location for renamed file
if (!this.prefs.getBoolPref("import")) var location=this.getFolder(item,this.prefs.getCharPref("dest_dir"),this.prefs.getCharPref("subfolderFormat"));
if ( this.prefs.getBoolPref("import")) var location=this.prefs.getCharPref("dest_dir");
 
// move file
var file_path=this.moveFile(file, location, filename);
// recreate the file nslFile Object
// (for some reason the Attachment is linked to the wrong location without recreation)
var file = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
file.initWithPath(file_path);
// Linked Attachments
if (!this.prefs.getBoolPref("import")) Zotero.Attachments.linkFromFile(file, item.itemID,item.libraryID);
 
// Imported Attachments - Attach last file to selected Zotero item
if(this.prefs.getBoolPref("import")) {
// Attach last file to selected Zotero item
Zotero.Attachments.importFromFile(file, item.itemID,item.libraryID);
//Delete the old file that is not longer needed
file.remove(false);
}
 
// Show message
this.infoWindow("Zotfile Report","File \'" + file_oldpath + "\' changed to \'" + file.leafName + "\' and added as an attachment.",8000);
}
}
else this.infoWindow("Zotfile Error","Unable to find file in " + this.prefs.getCharPref("source_dir"),8000);
}
else this.infoWindow("Zotfile Error","Selected item is either an Attachment, a note, or a collection.",8000);
},
// Rename & Move Existing Attachments
RenameAttachments: function(){
var items = ZoteroPane.getSelectedItems();
var confirmed=1;
if (items.length>=this.prefs.getIntPref("confirmation_batch")) var confirmed=confirm("You are about to rename and move the attachments of " + items.length + " items. Are you sure that you want to proceed? Your call!");
if(confirmed) for (var i=0; i < items.length; i++) {
var item = items[i];
var itemID = item.id;
// Zotero.Item.isImportedAttachment()
if(item.isRegularItem()) {
// get all attachments
var attachments = item.getAttachments();
 
// go through all attachments
// for (var j=0; j < attachments.length; j++) {
var j=0;
if (attachments.length==1) {
// get current attachments
var attID = item.getAttachments()[j];
var att = Zotero.Items.get(attID);
// get object of attached file
var infile = att.getFile();
// create file name using ZotFile rules
var filename = this.getFilename(item) + "." + this.getFiletype(infile.leafName);
// rename file associated with attachment
att.renameAttachmentFile(filename);
 
// change title of attachment item
att.setField('title', filename);
att.save();
// (a) LINKED ATTACHMENT TO IMPORTED ATTACHMENT
if (!att.isImportedAttachment() & this.prefs.getBoolPref("import")) {
// get object of attached file
var infile = att.getFile();
// Attach file to selected Zotero item
Zotero.Attachments.importFromFile(infile, itemID,item.libraryID);
// remove file from hard-driveĀ 
infile.remove(false);
 
// erase old attachment
att.erase();
this.infoWindow("Zotfile Report","Imported Attachment \'" + filename + "\'.",8000);
}
// (b) IMPORTED ATTACHMENT TO LINKED ATTACHMENT
// if (att.isImportedAttachment() & !this.prefs.getBoolPref("import")) {
if (!this.prefs.getBoolPref("import")) {
// get object of attached file
var infile = att.getFile();
// move pdf file
var location=this.getFolder(item,this.prefs.getCharPref("dest_dir"),this.prefs.getCharPref("subfolderFormat"));
var outfile_path=this.moveFile(infile,location , filename);
// recreate the outfile nslFile Object
// (for some reason the Attachment is linked to the wrong location without recreation)
var outfile = Components.classes["@mozilla.org/file/local;1"].
createInstance(Components.interfaces.nsILocalFile);
outfile.initWithPath(outfile_path);
// create linked attachment
Zotero.Attachments.linkFromFile(outfile, itemID,item.libraryID);
// erase old attachment
att.erase();
this.infoWindow("Zotfile Report","Linked Attachment \'" + filename + "\'.",8000);
}
}
}
}
}
};
 
 
 
// Initialize the utility
//window.addEventListener('load', function(e) { Zotero.ZotFile.init(); }, false);
 
 
//check whether it really is an bibliographic item (no Attachment, note or collection)
//if (!item.isAttachment() & !item.isCollection() & !item.isNote()) {
 
 
 
//if (item.isAttachment()) {
// consider that you there are multiple senarios
// a) attachment is linked, and the goal is to attach it
// b) attachment is attached, and the goal is to link it
// make sure that nothing bad happens if the attachment is already named correctly
//}
//if (item.isCollection() | item.isNote()) this.infoWindow("Zotfile Error","Selected item is either a note, or a collection.",8000);
zotfile.js (prefs)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
pref("extensions.zotfile.source_dir","~/Downloads");
pref("extensions.zotfile.dest_dir", "~/Documents/Literatur");
pref("extensions.zotfile.useZoteroToRename", false);
pref("extensions.zotfile.renameFormat", "%a_%y_%t");
pref("extensions.zotfile.renameFormat_patent", "%a_%y_%t");
pref("extensions.zotfile.max_titlelength", 80);
pref("extensions.zotfile.max_authors", 2);
pref("extensions.zotfile.add_etal", true);
pref("extensions.zotfile.etal", " et al");
pref("extensions.zotfile.confirmation", true);
pref("extensions.zotfile.confirmation_batch", 2);
pref("extensions.zotfile.import", false);
pref("extensions.zotfile.replace_blanks", false);
pref("extensions.zotfile.subfolder", false);
pref("extensions.zotfile.subfolderFormat", "/%w/%y");
pref("extensions.zotfile.converterPath", "c:\\Documents and Settings\\Avram\\My Documents\\Academic Large Documents\\Tethered Shooting\\process.bat");

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.