Unbreak post resurrection. Whoopse

This commit is contained in:
Zixaphir 2014-01-09 11:54:51 -07:00
parent 8f5b04a55f
commit da8bcab4f6
3 changed files with 32 additions and 33 deletions

View File

@ -9778,7 +9778,7 @@
Redirect = { Redirect = {
init: function() { init: function() {
var archive, archives, boardID, data, id, name, o, type, _i, _len, _ref, _ref1; var archive, archives, boardID, boards, data, files, id, name, o, record, software, type, _i, _len, _ref;
o = { o = {
thread: {}, thread: {},
post: {}, post: {},
@ -9787,27 +9787,27 @@
archives = Redirect.archives; archives = Redirect.archives;
_ref = Conf['selectedArchives']; _ref = Conf['selectedArchives'];
for (boardID in _ref) { for (boardID in _ref) {
data = _ref[boardID]; record = _ref[boardID];
for (type in data) { for (type in record) {
id = data[type]; id = record[type];
if ((archive = archives[id]) && __indexOf.call(archive[type] || archive['boards'], boardID) >= 0) { if ((archive = archives[id]) && __indexOf.call((type === 'file' ? archive['file'] : archive['boards']), boardID) >= 0) {
o[type][boardID] = archive.data; o[type][boardID] = archive.data;
} }
} }
} }
for (name in archives) { for (name in archives) {
archive = archives[name]; archive = archives[name];
_ref1 = archive.boards; data = archive.data, boards = archive.boards, files = archive.files;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) { software = data.software;
boardID = _ref1[_i]; for (_i = 0, _len = boards.length; _i < _len; _i++) {
data = archive.data; boardID = boards[_i];
if (!(boardID in o.thread)) { if (!(boardID in o.thread)) {
o.thread[boardID] = data; o.thread[boardID] = data;
} }
if (!(boardID in o.post || archive.software !== 'foolfuuka')) { if (!(boardID in o.post || software !== 'foolfuuka')) {
o.post[boardID] = data; o.post[boardID] = data;
} }
if (!(boardID in o.file || __indexOf.call(archive.files, boardID) < 0)) { if (!(boardID in o.file || __indexOf.call(files, boardID) < 0)) {
o.file[boardID] = data; o.file[boardID] = data;
} }
} }

View File

@ -9767,7 +9767,7 @@
Redirect = { Redirect = {
init: function() { init: function() {
var archive, archives, boardID, data, id, name, o, type, _i, _len, _ref, _ref1; var archive, archives, boardID, boards, data, files, id, name, o, record, software, type, _i, _len, _ref;
o = { o = {
thread: {}, thread: {},
post: {}, post: {},
@ -9776,31 +9776,32 @@
archives = Redirect.archives; archives = Redirect.archives;
_ref = Conf['selectedArchives']; _ref = Conf['selectedArchives'];
for (boardID in _ref) { for (boardID in _ref) {
data = _ref[boardID]; record = _ref[boardID];
for (type in data) { for (type in record) {
id = data[type]; id = record[type];
if ((archive = archives[id]) && __indexOf.call(archive[type] || archive['boards'], boardID) >= 0) { if ((archive = archives[id]) && __indexOf.call((type === 'file' ? archive['file'] : archive['boards']), boardID) >= 0) {
o[type][boardID] = archive.data; o[type][boardID] = archive.data;
} }
} }
} }
for (name in archives) { for (name in archives) {
archive = archives[name]; archive = archives[name];
_ref1 = archive.boards; data = archive.data, boards = archive.boards, files = archive.files;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) { software = data.software;
boardID = _ref1[_i]; for (_i = 0, _len = boards.length; _i < _len; _i++) {
data = archive.data; boardID = boards[_i];
if (!(boardID in o.thread)) { if (!(boardID in o.thread)) {
o.thread[boardID] = data; o.thread[boardID] = data;
} }
if (!(boardID in o.post || archive.software !== 'foolfuuka')) { if (!(boardID in o.post || software !== 'foolfuuka')) {
o.post[boardID] = data; o.post[boardID] = data;
} }
if (!(boardID in o.file || __indexOf.call(archive.files, boardID) < 0)) { if (!(boardID in o.file || __indexOf.call(files, boardID) < 0)) {
o.file[boardID] = data; o.file[boardID] = data;
} }
} }
} }
console.log(o);
return Redirect.data = o; return Redirect.data = o;
}, },
archives: { archives: {

View File

@ -8,20 +8,18 @@ Redirect =
{archives} = Redirect {archives} = Redirect
for boardID, data of Conf['selectedArchives'] for boardID, record of Conf['selectedArchives']
for type, id of data when (archive = archives[id]) and boardID in (archive[type] or archive['boards']) for type, id of record when (archive = archives[id]) and boardID in (if type is 'file' then archive['file'] else archive['boards'])
o[type][boardID] = archive.data o[type][boardID] = archive.data
for name, archive of archives for name, archive of archives
for boardID in archive.boards {data, boards, files} = archive
{data} = archive {software} = data
unless boardID of o.thread for boardID in boards
o.thread[boardID] = data o.thread[boardID] = data unless boardID of o.thread
unless boardID of o.post or archive.software isnt 'foolfuuka' o.post[boardID] = data unless boardID of o.post or software isnt 'foolfuuka'
o.post[boardID] = data o.file[boardID] = data unless boardID of o.file or boardID not in files
unless boardID of o.file or boardID not in archive.files
o.file[boardID] = data
Redirect.data = o Redirect.data = o
archives: archives: