mirror of
				https://github.com/blakeblackshear/frigate.git
				synced 2025-10-27 10:52:11 +01:00 
			
		
		
		
	Fix audio events in explore section (#15286)
* Fix audio events in explore section Make sure that audio events are listed in the explore section * Update audio.py * Hide other submit options Only allow submits for objects only
This commit is contained in:
		
							parent
							
								
									71e8f75a01
								
							
						
					
					
						commit
						5802a66469
					
				
							
								
								
									
										4
									
								
								docs/static/frigate-api.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								docs/static/frigate-api.yaml
									
									
									
									
										vendored
									
									
								
							| @ -3225,7 +3225,7 @@ components: | |||||||
|           title: Sub Label |           title: Sub Label | ||||||
|         score: |         score: | ||||||
|           anyOf: |           anyOf: | ||||||
|             - type: integer |             - type: number | ||||||
|             - type: 'null' |             - type: 'null' | ||||||
|           title: Score |           title: Score | ||||||
|           default: 0 |           default: 0 | ||||||
| @ -3264,7 +3264,7 @@ components: | |||||||
|       properties: |       properties: | ||||||
|         end_time: |         end_time: | ||||||
|           anyOf: |           anyOf: | ||||||
|             - type: integer |             - type: number | ||||||
|             - type: 'null' |             - type: 'null' | ||||||
|           title: End Time |           title: End Time | ||||||
|       type: object |       type: object | ||||||
|  | |||||||
| @ -17,14 +17,14 @@ class EventsDescriptionBody(BaseModel): | |||||||
| class EventsCreateBody(BaseModel): | class EventsCreateBody(BaseModel): | ||||||
|     source_type: Optional[str] = "api" |     source_type: Optional[str] = "api" | ||||||
|     sub_label: Optional[str] = None |     sub_label: Optional[str] = None | ||||||
|     score: Optional[int] = 0 |     score: Optional[float] = 0 | ||||||
|     duration: Optional[int] = 30 |     duration: Optional[int] = 30 | ||||||
|     include_recording: Optional[bool] = True |     include_recording: Optional[bool] = True | ||||||
|     draw: Optional[dict] = {} |     draw: Optional[dict] = {} | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class EventsEndBody(BaseModel): | class EventsEndBody(BaseModel): | ||||||
|     end_time: Optional[int] = None |     end_time: Optional[float] = None | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class SubmitPlusBody(BaseModel): | class SubmitPlusBody(BaseModel): | ||||||
|  | |||||||
| @ -216,6 +216,10 @@ class AudioEventMaintainer(threading.Thread): | |||||||
|                     "label": label, |                     "label": label, | ||||||
|                     "last_detection": datetime.datetime.now().timestamp(), |                     "last_detection": datetime.datetime.now().timestamp(), | ||||||
|                 } |                 } | ||||||
|  |             else: | ||||||
|  |                 self.logger.warning( | ||||||
|  |                     f"Failed to create audio event with status code {resp.status_code}" | ||||||
|  |                 ) | ||||||
| 
 | 
 | ||||||
|     def expire_detections(self) -> None: |     def expire_detections(self) -> None: | ||||||
|         now = datetime.datetime.now().timestamp() |         now = datetime.datetime.now().timestamp() | ||||||
|  | |||||||
| @ -108,6 +108,7 @@ class ExternalEventProcessor: | |||||||
|                 EventTypeEnum.api, |                 EventTypeEnum.api, | ||||||
|                 EventStateEnum.end, |                 EventStateEnum.end, | ||||||
|                 None, |                 None, | ||||||
|  |                 "", | ||||||
|                 {"id": event_id, "end_time": end_time}, |                 {"id": event_id, "end_time": end_time}, | ||||||
|             ) |             ) | ||||||
|         ) |         ) | ||||||
|  | |||||||
| @ -128,6 +128,7 @@ export default function SearchResultActions({ | |||||||
|         config?.plus?.enabled && |         config?.plus?.enabled && | ||||||
|         searchResult.has_snapshot && |         searchResult.has_snapshot && | ||||||
|         searchResult.end_time && |         searchResult.end_time && | ||||||
|  |         searchResult.data.type == "object" && | ||||||
|         !searchResult.plus_id && ( |         !searchResult.plus_id && ( | ||||||
|           <MenuItem aria-label="Submit to Frigate Plus" onClick={showSnapshot}> |           <MenuItem aria-label="Submit to Frigate Plus" onClick={showSnapshot}> | ||||||
|             <FrigatePlusIcon className="mr-2 size-4 cursor-pointer text-primary" /> |             <FrigatePlusIcon className="mr-2 size-4 cursor-pointer text-primary" /> | ||||||
| @ -197,6 +198,7 @@ export default function SearchResultActions({ | |||||||
|             config?.plus?.enabled && |             config?.plus?.enabled && | ||||||
|             searchResult.has_snapshot && |             searchResult.has_snapshot && | ||||||
|             searchResult.end_time && |             searchResult.end_time && | ||||||
|  |             searchResult.data.type == "object" && | ||||||
|             !searchResult.plus_id && ( |             !searchResult.plus_id && ( | ||||||
|               <Tooltip> |               <Tooltip> | ||||||
|                 <TooltipTrigger> |                 <TooltipTrigger> | ||||||
|  | |||||||
| @ -379,6 +379,7 @@ function EventItem({ | |||||||
| 
 | 
 | ||||||
|               {event.has_snapshot && |               {event.has_snapshot && | ||||||
|                 event.plus_id == undefined && |                 event.plus_id == undefined && | ||||||
|  |                 event.data.type == "object" && | ||||||
|                 config?.plus.enabled && ( |                 config?.plus.enabled && ( | ||||||
|                   <Tooltip> |                   <Tooltip> | ||||||
|                     <TooltipTrigger> |                     <TooltipTrigger> | ||||||
|  | |||||||
| @ -626,7 +626,7 @@ export function ObjectSnapshotTab({ | |||||||
|                 </div> |                 </div> | ||||||
|               )} |               )} | ||||||
|             </TransformComponent> |             </TransformComponent> | ||||||
|             {search.plus_id !== "not_enabled" && search.end_time && ( |             {search.data.type == "object" && search.plus_id !== "not_enabled" && search.end_time && ( | ||||||
|               <Card className="p-1 text-sm md:p-2"> |               <Card className="p-1 text-sm md:p-2"> | ||||||
|                 <CardContent className="flex flex-col items-center justify-between gap-3 p-2 md:flex-row"> |                 <CardContent className="flex flex-col items-center justify-between gap-3 p-2 md:flex-row"> | ||||||
|                   <div className={cn("flex flex-col space-y-3")}> |                   <div className={cn("flex flex-col space-y-3")}> | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user