Example #1
0
 def _threadDoGETJob( self, request ):
     
     self._checkBandwidth( request )
     
     # no permission check as any functional account can get thumbnails
     
     hash = request.hydrus_args[ 'hash' ]
     
     ( valid, mime ) = HG.server_controller.Read( 'service_has_file', self._service_key, hash )
     
     if not valid:
         
         raise HydrusExceptions.NotFoundException( 'Thumbnail not found on this service!' )
         
     
     if mime not in HC.MIMES_WITH_THUMBNAILS:
         
         raise HydrusExceptions.NotFoundException( 'That mime should not have a thumbnail!' )
         
     
     path = ServerFiles.GetThumbnailPath( hash )
     
     response_context = HydrusServerResources.ResponseContext( 200, mime = HC.APPLICATION_OCTET_STREAM, path = path )
     
     return response_context
Example #2
0
    def _threadDoGETJob(self, request):

        hash = request.hydrus_args['hash']

        # don't I need to check that we aren't stealing the file from another service?

        path = ServerFiles.GetThumbnailPath(hash)

        response_context = HydrusServerResources.ResponseContext(200,
                                                                 path=path)

        return response_context