Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through audiobook duration for Libro.fm #187

Merged
merged 7 commits into from
Jan 3, 2025
Merged

Pass through audiobook duration for Libro.fm #187

merged 7 commits into from
Jan 3, 2025

Conversation

katydecorah
Copy link
Member

Ref #186

(Still trying to figure out how to get duration from others like Libby)

@katydecorah katydecorah requested a review from Copilot January 2, 2025 01:04

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 14 changed files in this pull request and generated no comments.

Files not reviewed (7)
  • package.json: Language not supported
  • src/tests/providers/librofm/fixture-9781250752864.json: Language not supported
  • src/tests/providers/librofm/fixture-9781797176888.json: Language not supported
  • src/tests/workflow-librofm.test.ts: Evaluated as low risk
  • src/tests/providers/librofm.test.ts: Evaluated as low risk
  • src/new-book.ts: Evaluated as low risk
  • src/providers/isbn.ts: Evaluated as low risk
Comments suppressed due to low confidence (8)

src/tests/workflow-summary.test.ts:74

  • The test output includes 'hours' twice. It should be '7 hours, 45 minutes'.
"Longest book by duration:" “Book 4” by Author 4 (7 hours, 45 minutes hours)

src/tests/workflow-summary.test.ts:75

  • The test output includes 'hours' twice. It should be '3 hours, 20 minutes'.
"Shortest book by duration:" “Book 6” by Author 6 (3 hours, 20 minutes hours)

src/summary-markdown.ts:132

  • The label 'hours' might be misleading if the duration includes minutes. Consider using a more precise label like 'duration'.
result.push(`- **${label}:** ${book.title} by ${book.authors} (${book.length} hours)`);

src/summary-markdown.ts:120

  • [nitpick] The 'length' property is used to represent both page count and duration, which could be confusing. Consider using separate properties for page count and duration.
result.push(`- **${label}:** ${book.title} by ${book.authors} (${book.length} pages)`);

src/tests/summary.test.ts:122

  • Ensure that the average book length by duration is correctly calculated and displayed in the summary. Add test cases for scenarios with and without duration data.
"averageBookLengthByDuration": "",

src/summary.ts:206

  • [nitpick] The property 'length' is ambiguous as it can refer to both page count and duration. Consider renaming it to 'pageCountOrDuration' or similar to make it clear.
length: number | string;

src/summary.ts:294

  • [nitpick] The property 'durationInSeconds' should be consistently named. Consider renaming it to 'durationSeconds' for brevity and clarity.
durationInSeconds: parseISO8601Duration(b.duration),

src/summary.ts:145

  • Ensure that the new behavior for calculating and displaying average book length by duration is covered by tests.
averageBookLengthByDuration: secondsToHms(averageBookLengthByDuration),
@katydecorah katydecorah requested a review from Copilot January 3, 2025 00:44

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 14 changed files in this pull request and generated no comments.

Files not reviewed (7)
  • package.json: Language not supported
  • src/tests/providers/librofm/fixture-9781250752864.json: Language not supported
  • src/tests/providers/librofm/fixture-9781797176888.json: Language not supported
  • src/tests/providers/librofm.test.ts: Evaluated as low risk
  • src/tests/summary.test.ts: Evaluated as low risk
  • src/tests/workflow-librofm.test.ts: Evaluated as low risk
  • src/tests/workflow-summary.test.ts: Evaluated as low risk
Comments suppressed due to low confidence (3)

src/summary-markdown.ts:116

  • The length parameter can be either a number or a string, which might cause inconsistencies in the output format. Ensure that the length parameter is consistently formatted as a string in both addBookLength and addBookDuration functions.
book?: { title: string; authors: string; length: number | string }

src/summary.ts:204

  • [nitpick] The field name 'length' is ambiguous. It should be renamed to something more descriptive like 'pageCountOrDuration'.
length: book.pageCount ?? book.durationHours ?? 0,

src/summary.ts:312

  • Ensure that all edge cases for sorting books by duration are covered by tests.
function sortBooksByDuration(booksThisYear): NewBook[] {
@katydecorah katydecorah merged commit 40c1447 into main Jan 3, 2025
3 checks passed
@katydecorah katydecorah deleted the duration branch January 3, 2025 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant