Instruction file imported from jyourstone/jellyfin-musictags-plugin (
.cursor/rules/html.mdc). Copyright stays with the author.
description: globs: *.html alwaysApply: false
1. JavaScript Environment Limitations
The Jellyfin plugin configuration page has a specific JavaScript environment that must be respected.
-
No Template Literals: Do not use ES6 template literals (backticks
`) for string formatting. This environment does not support them. All dynamic strings must be constructed using traditional string concatenation with the+operator. -
Use Inline Notifications: Jellyfin's
Dashboard.alert()function is unreliable and fails silently. Standard browseralert()is also discouraged as it is intrusive. All user-facing messages (both success and error) must be displayed using the project's customshowNotification(message, type)function.
2. API Error Handling
When handling API errors, remember that the server returns error messages in a specific format.
- A
400 Bad Requestfrom the backend API will contain a JSON-encoded string in the response body. This is not a JSON object. You must call.text()on theResponseobject and then useJSON.parse()on the resulting string to get the clean error message. Forgetting to parse the JSON string will result in a message wrapped in quotes being displayed.
3. UI Styling and CSS
To maintain a consistent and professional appearance, all UI elements must use Jellyfin's standard CSS classes.
- Avoid using custom inline styles for layout and component styling. Instead, use Jellyfin's predefined classes like
inputContainer,inputLabelsectionTitle,checkboxLabel,fieldDescription,emby-button, andraisedto ensure the plugin's UI matches the native Jellyfin look and feel.