diff --git a/src/components/video.tsx b/src/components/video.tsx index cfa17e4..bfb74cf 100644 --- a/src/components/video.tsx +++ b/src/components/video.tsx @@ -1,9 +1,11 @@ -import { formatUrl } from "../utils"; +import { formatUrl, generateRemainderScript } from "../utils"; import { Action, ActionPanel, Color, Icon, Image, List, showToast, Toast } from "@raycast/api"; import { ConclusionView } from "./conslusionView"; import { runAppleScript } from "run-applescript"; +const { Metadata } = List.Item.Detail; + export function Video(props: { title: string; cover: string; @@ -25,27 +27,7 @@ export function Video(props: { }) { async function addWatchLaterReminder() { try { - await runAppleScript(` - tell application "Reminders" - try - get list "Raycast Bilibili" - set mylist to list "Raycast Bilibili" - tell mylist - make new reminder with properties {name:"${props.title} - ${props.uploader.name}", body:"${formatUrl( - props.url - )}"} - end tell - on error - make new list with properties {name:"Raycast Bilibili"} - set mylist to list "Raycast Bilibili" - tell mylist - make new reminder with properties {name:"${props.title} - ${props.uploader.name}", body:"${formatUrl( - props.url - )}"} - end tell - end try - end tell - `); + await runAppleScript(generateRemainderScript(props.title, props.uploader.name, props.url)); await showToast({ style: Toast.Style.Success, @@ -65,9 +47,9 @@ export function Video(props: { `} metadata={ - - - + + - - - + + + {props.stat.highlight && ( - + )} {props.stat.view && ( - + )} {props.stat.coin && ( - + )} {props.stat.view && ( - + )} {props.stat.danmaku && ( - + )} - - + + } /> } diff --git a/src/notifications.tsx b/src/notifications.tsx index ea50b30..30493d3 100644 --- a/src/notifications.tsx +++ b/src/notifications.tsx @@ -95,7 +95,6 @@ export default async function Command() { const unNotifies = newNotifications.slice(0, startNotifyIndex); for (const unNotify of unNotifies) { - console.log(unNotify); items.map(async (item) => { if (item.id_str === unNotify) { notify(item); diff --git a/src/searchVideos.tsx b/src/searchVideos.tsx index 4b846b1..3922fe4 100644 --- a/src/searchVideos.tsx +++ b/src/searchVideos.tsx @@ -28,7 +28,6 @@ export default function Command() { }} > {videoResults?.map((item) => { - console.log(item) return (