fredrikburmester / streamyfin

A Jellyfin client build with Expo
Mozilla Public License 2.0
1.12k stars 31 forks source link

feat: Hide 0h on play button when media length is lower than an hour #183

Closed simoncaron closed 1 month ago

simoncaron commented 1 month ago

Title says it all. Will address #153.

Before

After

Summary by Sourcery

New Features:

sourcery-ai[bot] commented 1 month ago

Reviewer's Guide by Sourcery

This pull request implements a feature to hide the '0h' display on the play button when the media length is less than an hour. The change is made in the runtimeTicksToMinutes function within the utils/time.ts file.

User journey diagram for media length display update

journey
    title User journey for media length display update
    section Before
      User: Clicks play button
      User: Sees '0h 30m' for media less than an hour
    section After
      User: Clicks play button
      User: Sees '30m' for media less than an hour

File-Level Changes

Change Details Files
Modified time formatting logic to omit hours when media length is less than an hour
  • Added a conditional statement to check if hours are greater than 0
  • Return only minutes when hours are 0
  • Maintain the original format when hours are greater than 0
utils/time.ts

Possibly linked issues


Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).