Skip to content

Commit

Permalink
add license
Browse files Browse the repository at this point in the history
  • Loading branch information
nimarion committed Oct 3, 2023
1 parent d5bccf1 commit 1e20323
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 19 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Niklas Marion

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Photofinish Server

Listet live alle Photofinish übersichtlich auf einer Webseite auf. JPG Dateien werden aus dem Ordner public/images geladen und auf ITPC Daten geprüft welche von der Omega Photofinish Software gesetzt werden können. Für dieses Projekt muss der Laufname in das ObjectName Feld geschrieben werden und die Startzeit in das Headline Feld. Die dafür angepasst Datei [pictureTags.iptc](pictureTags.iptc) muss zur Nutzung in den Ordner C:\OSV-Star\Template gelegt werden.
PhotoFinish Server is a platform designed for real-time publishing of photofinish images to the public. This system utilizes embedded metadata within the images to provide viewers with comprehensive information, including race results, reaction times, and windspeed, all seamlessly integrated with the image.

![OSV Settings](docs/osv_settings.png)
[Live Demo](https://photofinish.lcrehlingen.de/58.%20Pfingstsportfest_28052023)

Das Verzeichnis für den Export sollte entsprechend angepasst werden damit die Bilder von nextjs gefunden werden können.
## Built with

- [Remix](https://github.com/remix-run/remix)
- [Exifr](https://github.com/MikeKovarik/exifr)
- [Chokidar](https://github.com/paulmillr/chokidar)
- [socket.io](https://github.com/socketio/socket.io)

![Overview](docs/overview_page.png)
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

![Competition](docs/competition_page.png)
<p align="center">
<img alt="Haha yes " width="250px" src="https://i.imgur.com/5bXJeZt.png">
<br>
</p>
12 changes: 3 additions & 9 deletions app/routes/$id.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { useLoaderData, useParams } from "@remix-run/react";
import ContentContainer from "~/components/ContentContainer";
import Title from "~/components/Title";
import ReactModal from "react-modal";
import React, { useContext, useEffect, useState } from "react";
import { useContext, useEffect, useState } from "react";
import ImageCard from "~/components/card/ImageHard";
import { wsContext } from "~/ws-context";
import Eyes from "~/components/icons/Eyes";
Expand All @@ -15,13 +15,7 @@ import type { Image } from "~/types";

export const loader = async ({ params }: LoaderFunctionArgs) => {
const IMAGE_FOLDER = path.join(process.cwd(), "public", "images");
const competitionId = params.id;
if (!competitionId) {
throw new Response(null, {
status: 404,
statusText: "Not Found",
});
}
const competitionId = params.id as string;
if (!fs.existsSync(path.join(IMAGE_FOLDER, competitionId))) {
throw new Response(null, {
status: 404,
Expand Down Expand Up @@ -65,7 +59,7 @@ export const loader = async ({ params }: LoaderFunctionArgs) => {
}) as Image[];

const title = competitionId.slice(0, -9);
return json({ title, images: images.filter((image) => image != null) });
return json({ title: title === "MTG" ? "MTG: Offene Vereinsmeisterschaften": title, images: images.filter((image) => image != null) });
};

export default function Index() {
Expand Down
2 changes: 1 addition & 1 deletion app/routes/_index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const loader = async () => {
const date = new Date(year, month, day).getTime() / 1000;
return {
id,
name,
name: name === "MTG" ? "MTG: Offene Vereinsmeisterschaften": name,
date,
thumbnail: hasThumbnail ? thumbnail : undefined,
};
Expand Down
8 changes: 4 additions & 4 deletions app/services/iptc.parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ const captionSchema = z.object({
type CaptionEntry = z.infer<typeof captionSchema>;

const iptcSchema = z.object({
Headline: z.string().min(1),
Caption: z.string().min(1),
ObjectName: z.string().min(1),
Headline: z.string(), // Time of start
Caption: z.string().min(1), // Results, Reaction time, Wind speed as csv
ObjectName: z.string().min(1), // Title
});

export async function parseIptcFromFile(file: string): Promise<Image | null> {
Expand All @@ -42,7 +42,7 @@ export async function parseIptcFromFile(file: string): Promise<Image | null> {
filename: path.parse(file).base,
title,
timestamp:
timestamp == "0" ? 0 : new Date(`1970-01-01T${timestamp}Z`).getTime(),
timestamp == "" || timestamp == "0" ? 0 : new Date(`1970-01-01T${timestamp}Z`).getTime(),
athletes,
windSpeed,
};
Expand Down

0 comments on commit 1e20323

Please sign in to comment.