WIP Does not yet regenerate if instance is deleted (ie it will still reuturn the instance, but doesn't regenerate preview) Also discussion in design doc, not clear if doing order by here is a good idea
(self, session)
| 209 | |
| 210 | |
| 211 | def get_preview_instance(self, session): |
| 212 | """ |
| 213 | WIP |
| 214 | Does not yet regenerate if instance is deleted |
| 215 | (ie it will still reuturn the instance, but doesn't regenerate |
| 216 | preview) |
| 217 | |
| 218 | Also discussion in design doc, not clear if doing order |
| 219 | by here is a good idea |
| 220 | |
| 221 | """ |
| 222 | instance = session.query(Instance).filter( |
| 223 | Instance.sequence_id == self.id, |
| 224 | Instance.soft_delete == False).order_by(Instance.id) |
| 225 | instance = instance.first() |
| 226 | |
| 227 | """ |
| 228 | Issue is that this doesn't directly refresh cache, it just ensures |
| 229 | the instance we are getting has a thumbnail. |
| 230 | """ |
| 231 | if instance: |
| 232 | logger.debug(f"Regenerating instance thumb for {instance.id}") |
| 233 | self.regenerate_instance_thumb( |
| 234 | session = session, |
| 235 | instance = instance) |
| 236 | |
| 237 | return instance |
| 238 | |
| 239 | def frame_list(self, |
| 240 | session): |
no test coverage detected