@@ -55,21 +55,31 @@ def make_entry(edict):
5555 'mime_major' : edict ['img_major_mime' ],
5656 'mime_minor' : edict ['img_minor_mime' ],
5757 'width' : width ,
58- 'height' : height ,
59- 'upload_user_id' : edict ['img_user' ],
60- 'upload_user_text' : edict ['img_user_text' ]}
58+ 'height' : height }
59+
6160 if edict .get ('oi_archive_name' ):
62- # The file has multiple versions
61+ # Issue #448 fix: prioritize original uploader
62+ raw_entry ['upload_user_id' ] = edict ['rec_img_user' ]
63+ raw_entry ['upload_user_text' ] = edict ['rec_img_text' ]
64+ raw_entry ['upload_date' ] = wpts2dt (edict ['rec_img_timestamp' ])
65+
6366 raw_entry ['flags' ] = {
6467 'reupload' : True ,
65- 'reupload_date' : wpts2dt (edict ['rec_img_timestamp ' ]),
66- 'reupload_user_id' : edict ['rec_img_user ' ],
67- 'reupload_user_text' : edict ['rec_img_text ' ],
68+ 'reupload_date' : wpts2dt (edict ['img_timestamp ' ]),
69+ 'reupload_user_id' : edict ['img_user ' ],
70+ 'reupload_user_text' : edict ['img_user_text ' ],
6871 'archive_name' : edict ['oi_archive_name' ]}
69- raw_entry ['upload_date' ] = wpts2dt (edict ['img_timestamp' ])
72+ else :
73+ raw_entry ['upload_user_id' ] = edict ['img_user' ]
74+ raw_entry ['upload_user_text' ] = edict ['img_user_text' ]
75+ raw_entry ['upload_date' ] = wpts2dt (edict ['img_timestamp' ])
76+
7077 raw_entry ['resolution' ] = width * height
7178 if edict .get ('flags' ):
72- raw_entry ['flags' ] = edict ['flags' ]
79+ if 'flags' in raw_entry :
80+ raw_entry ['flags' ].update (edict ['flags' ])
81+ else :
82+ raw_entry ['flags' ] = edict ['flags' ]
7383 return montage .rdb .Entry (** raw_entry )
7484
7585
0 commit comments