Merge branch 'release-0.11.0' of https://github.com/blakeblackshear/frigate into sub_label_filter

This commit is contained in:
Nick Mowen 2022-05-26 09:18:28 -06:00
commit cbfebe499f
2 changed files with 33 additions and 10 deletions

View File

@ -46,6 +46,7 @@ RUN pip3 wheel --wheel-dir=/wheels -r requirements-wheels.txt
FROM debian:11-slim FROM debian:11-slim
ARG TARGETARCH ARG TARGETARCH
ARG JELLYFIN_FFMPEG_VERSION=4.3.2-1
# https://askubuntu.com/questions/972516/debian-frontend-environment-variable # https://askubuntu.com/questions/972516/debian-frontend-environment-variable
ARG DEBIAN_FRONTEND="noninteractive" ARG DEBIAN_FRONTEND="noninteractive"
# http://stackoverflow.com/questions/48162574/ddg#49462622 # http://stackoverflow.com/questions/48162574/ddg#49462622
@ -72,9 +73,6 @@ RUN apt-get -qq update \
&& apt-key adv --fetch-keys https://packages.cloud.google.com/apt/doc/apt-key.gpg \ && apt-key adv --fetch-keys https://packages.cloud.google.com/apt/doc/apt-key.gpg \
&& echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \ && echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" > /etc/apt/sources.list.d/coral-edgetpu.list \
&& echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \ && echo "libedgetpu1-max libedgetpu/accepted-eula select true" | debconf-set-selections \
# jellyfin-ffmpeg
&& wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add - \
&& echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | tee /etc/apt/sources.list.d/jellyfin.list \
&& apt-get -qq update \ && apt-get -qq update \
&& apt-get -qq install --no-install-recommends --no-install-suggests -y \ && apt-get -qq install --no-install-recommends --no-install-suggests -y \
# coral drivers # coral drivers
@ -82,8 +80,11 @@ RUN apt-get -qq update \
&& pip3 install -U /wheels/*.whl \ && pip3 install -U /wheels/*.whl \
# arch specific packages # arch specific packages
&& if [ "${TARGETARCH}" = "amd64" ]; then \ && if [ "${TARGETARCH}" = "amd64" ]; then \
apt-get -qq install --no-install-recommends --no-install-suggests -y \ # jellyfin-ffmpeg
mesa-va-drivers jellyfin-ffmpeg; else \ wget -O /tmp/jellyfin.deb "https://repo.jellyfin.org/releases/server/debian/versions/jellyfin-ffmpeg/${JELLYFIN_FFMPEG_VERSION}/jellyfin-ffmpeg_${JELLYFIN_FFMPEG_VERSION}-$( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release )_$( dpkg --print-architecture ).deb" \
&& apt-get -qq install --no-install-recommends --no-install-suggests -y \
mesa-va-drivers /tmp/jellyfin.deb \
&& rm /tmp/jellyfin.deb; else \
apt-get -qq install --no-install-recommends --no-install-suggests -y \ apt-get -qq install --no-install-recommends --no-install-suggests -y \
ffmpeg; \ ffmpeg; \
fi \ fi \

View File

@ -60,6 +60,10 @@ export default function Events({ path, ...props }) {
has_snapshot: false, has_snapshot: false,
plus_id: undefined, plus_id: undefined,
}); });
const [deleteFavoriteState, setDeleteFavoriteState] = useState({
deletingFavoriteEventId: null,
showDeleteFavorite: false,
});
const eventsFetcher = useCallback((path, params) => { const eventsFetcher = useCallback((path, params) => {
params = { ...params, include_thumbnails: 0, limit: API_LIMIT }; params = { ...params, include_thumbnails: 0, limit: API_LIMIT };
@ -118,11 +122,16 @@ export default function Events({ path, ...props }) {
} }
}; };
const onDelete = async (e, eventId) => { const onDelete = async (e, eventId, saved) => {
e.stopPropagation(); e.stopPropagation();
const response = await axios.delete(`events/${eventId}`);
if (response.status === 200) { if (saved) {
mutate(); setDeleteFavoriteState({ deletingFavoriteEventId: eventId, showDeleteFavorite: true });
} else {
const response = await axios.delete(`events/${eventId}`);
if (response.status === 200) {
mutate();
}
} }
}; };
@ -393,6 +402,19 @@ export default function Events({ path, ...props }) {
</div> </div>
</Dialog> </Dialog>
)} )}
{deleteFavoriteState.showDeleteFavorite && (
<Dialog>
<div className="p-4">
<Heading size="lg">Delete Saved Event?</Heading>
<p className="mb-2">Confirm deletion of saved event.</p>
</div>
<div className="p-2 flex justify-start flex-row-reverse space-x-2">
<Button className="ml-2" color="red" onClick={(e) => { setDeleteFavoriteState({ ...state, showDeleteFavorite: false }); onDelete(e, deleteFavoriteState.deletingFavoriteEventId, false) }} type="text">
Delete
</Button>
</div>
</Dialog>
)}
<div className="space-y-2"> <div className="space-y-2">
{eventPages ? ( {eventPages ? (
eventPages.map((page, i) => { eventPages.map((page, i) => {
@ -460,7 +482,7 @@ export default function Events({ path, ...props }) {
)} )}
</div> </div>
<div class="flex flex-col"> <div class="flex flex-col">
<Delete className="h-6 w-6 cursor-pointer" stroke="#f87171" onClick={(e) => onDelete(e, event.id)} /> <Delete className="h-6 w-6 cursor-pointer" stroke="#f87171" onClick={(e) => onDelete(e, event.id, event.retain_indefinitely)} />
<Download <Download
className="h-6 w-6 mt-auto" className="h-6 w-6 mt-auto"