Skip to content

Commit

Permalink
songs mp3
Browse files Browse the repository at this point in the history
  • Loading branch information
Diebbo committed Dec 10, 2024
1 parent d581664 commit 80e948f
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 19 deletions.
8 changes: 0 additions & 8 deletions client/components/calendar/eventAdder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ async function createEvent(
resourceId: string | undefined,
): Promise<boolean> {
try {
console.log("evento aggiunto", event);
var res = await fetch(`${EVENTS_API_URL}`, {
method: "PUT",
headers: {
Expand All @@ -64,7 +63,6 @@ async function createEvent(
throw new Error("Failed to create events");
}

console.log("aggiungo la risorsa con Id: ", resourceId);
if (resourceId !== undefined) {
res = await fetch(`${EVENTS_API_URL}/resource/${resourceId}`, {
method: "PATCH",
Expand Down Expand Up @@ -137,7 +135,6 @@ const EventAdder: React.FC<EventAdderProps> = ({
isMobile,
resource,
}) => {
console.log("eventAdder risorse", resource);
const [isOpen, setIsOpen] = useState(false);
const [availableResources, setAvailableResources] = useState<ResourceModel[]>(
[],
Expand Down Expand Up @@ -192,7 +189,6 @@ const EventAdder: React.FC<EventAdderProps> = ({
eventData.dtend as Date,
),
);
console.log("available: ", available);
setAvailableResources(available);
}, [eventData.dtstart, eventData.dtend, resource]);

Expand Down Expand Up @@ -273,7 +269,6 @@ const EventAdder: React.FC<EventAdderProps> = ({
return false;
});

console.log("suggestions: ", suggestions);
setLocationSuggestions(suggestions);
} catch (error) {
console.error("Error fetching location suggestions:", error);
Expand Down Expand Up @@ -410,15 +405,13 @@ const EventAdder: React.FC<EventAdderProps> = ({
...prev,
rrule: newRrule,
}));
console.log("newRrule", newRrule);
};

const handleParticipantSelect = (friend: Person) => {
setEventData((prev) => ({
...prev,
participants: [...(prev.participants || []), { _id: friend._id } as Partial<Person>],
}));
console.log(eventData.participants);
};

const handleRemoveParticipant = (friendToRemove: Person) => {
Expand Down Expand Up @@ -486,7 +479,6 @@ const EventAdder: React.FC<EventAdderProps> = ({
return;
}

console.log("isError", isError, "dateError", dateError);
if (!isError && !notificationError && !dateError) {
const newEvent: SelfieEvent = {
...eventData,
Expand Down
4 changes: 0 additions & 4 deletions client/components/calendar/showEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -523,16 +523,13 @@ const ShowEvent: React.FC<ShowEventProps> = ({
}

const oldR = resource.find((r) => r.name === selectedEvent?.resource);
console.log("oldR", oldR);
const newR = resource.find((r) => r.name === updatedEvent?.resource);
console.log("newR", newR);

const oldBookId = oldR?.used.find(
(r) =>
r.startTime === selectedEvent?.dtstart &&
r.endTime === selectedEvent.dtend,
)?._id;
console.log("oldBookId:", oldBookId, oldR?._id);

// caso 1: unbook risorsa (x -> 0)
var res;
Expand All @@ -555,7 +552,6 @@ const ShowEvent: React.FC<ShowEventProps> = ({
const q =
`${EVENTS_API_URL}/resource/${newR?._id}` +
(oldBookId !== undefined ? `?oldBookId=${oldBookId}` : "");
console.log("query", q);
res = await fetch(q, {
method: "PATCH",
headers: {
Expand Down
4 changes: 2 additions & 2 deletions client/components/music-player/MusicPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default function MusicPlayer() {
? await musicPlayerService.fetchRandomSong()
: await musicPlayerService.fetchNextSong();
setCurrentSong(song);
audioElement.src = "/song/" + song.title + ".wav";
audioElement.src = "/song/" + song.title + ".mp3";
await audioElement.load();
const playPromise = audioElement.play();
if (playPromise !== undefined) {
Expand All @@ -124,7 +124,7 @@ export default function MusicPlayer() {
? await musicPlayerService.fetchRandomSong()
: await musicPlayerService.fetchPrevSong();
setCurrentSong(song);
audioElement.src = "/song/" + song.title + ".wav";
audioElement.src = "/song/" + song.title + ".mp3";
await audioElement.load();
const playPromise = audioElement.play();
if (playPromise !== undefined) {
Expand Down
3 changes: 0 additions & 3 deletions client/components/navbar/notifications-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export const NotificationsDropdown = () => {
method: "GET",
credentials: "include",
});
console.log("END FETCHING NOTIFICATIONS");

if (!response.ok) {
throw new Error("Failed to fetch notifications");
Expand Down Expand Up @@ -86,7 +85,6 @@ export const NotificationsDropdown = () => {
throw new Error("Socket URL not defined");
}
socketRef.current = io(process.env.NEXT_PUBLIC_SOCKET_URL as string);
console.log("Connected to socket notification server");

socketRef.current.on("connect", () => {
console.log("Connected to notification server");
Expand All @@ -99,7 +97,6 @@ export const NotificationsDropdown = () => {
socketRef.current.on(
"new_notification",
(notification: Notification) => {
console.log("Received new notification", notification);
setNotifications((prev) => [notification, ...prev]);

toast(
Expand Down
2 changes: 0 additions & 2 deletions server/src/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export function createWebSocket(io, database, sendNotification) {
let typingTimeout = null;

socket.on("typing_start", ({ senderUsername, receiverUsername }) => {
console.log("typing_start");
if (typingTimeout) clearTimeout(typingTimeout);
typingTimeout = setTimeout(async () => {
const receiverId =
Expand All @@ -167,7 +166,6 @@ export function createWebSocket(io, database, sendNotification) {
});

socket.on("typing_end", async ({ senderUsername, receiverUsername }) => {
console.log("typing_end");
try {
const receiverId =
await database.userService.fromUsernameToId(receiverUsername);
Expand Down

0 comments on commit 80e948f

Please sign in to comment.