export default class MonitorListRow extends HTMLTableRowElement { constructor() { super(); this.downloadId = this.getAttribute('monitor-id'); this.imdbId = this.getAttribute('imdb-id'); this.mediaTitle = this.getAttribute('media-title'); this.url = this.getAttribute('url'); this.filename = this.getAttribute('filename'); this.status = this.getAttribute('status'); this.progress = this.getAttribute('progress'); this.mediaType = this.getAttribute('media-type'); this.episodeId = this.getAttribute('episode-id'); this.createdAt = this.getAttribute('created-at'); this.updatedAt = this.getAttribute('updated-at'); } static get observedAttributes() { return ['download-id', 'imdb-id', 'media-title', 'url', 'filename', 'status', 'progress', 'media-type', 'episode-id', 'created-at', 'updated-at']; } attributeChangedCallback(name, oldValue, newValue) { if (oldValue !== newValue) { this[name] = newValue; this.setAttribute(name, newValue); this.setPreviewContent(); } } setPreviewContent() { this.previewContent = `
ID
IMDB ID
Title
Season
Episode
Status
Search Count
Media Type
Episode ID
Created At
Updated At
Downloaded At
${this.getAttribute('monitor-id') ?? "-"}
${this.getAttribute('imdb-id') ?? "-"}
${this.getAttribute('media-title') ?? "-"}
${this.getAttribute('season') ?? "-"}
${this.getAttribute('episode') ?? "-"}
${this.getAttribute('status') ?? "-"}
${this.getAttribute('search-count') ?? "-"}
${this.getAttribute('media-type') ?? "-"}
${this.getAttribute('episode-id') ?? "-"}
${this.getAttribute('created-at') ?? "-"}
${this.getAttribute('last-search') ?? "-"}
${this.getAttribute('downloaded-at') ?? "-"}
`; } }