Skip to content

Commit

Permalink
fix: season ux
Browse files Browse the repository at this point in the history
  • Loading branch information
a1mersnow committed Nov 18, 2023
1 parent c0669b1 commit 4004870
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "aliyundrive-rename",
"type": "module",
"version": "0.2.2",
"version": "0.2.3",
"private": true,
"packageManager": "[email protected]",
"description": "Batch rename files of aliyundrive.",
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ function manualPickName(id: string) {
</div>
<div>
<label class="mb-1 block">季</label>
<input v-model="season" placeholder="请输入数字" class="h-8 w-full rounded bg-white px-3 outline-none">
<input v-model="season" placeholder="0~99" class="h-8 w-full rounded bg-white px-3 outline-none">
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion src/utils/rename.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function getNewNameByExtract(oldName: string, prefix: string, season: str
let episode = epm1 || epm2 || epm3 || epm4
season ||= '1'
const seasonNumber = Number.parseInt(season)
const seasonNumberIsValid = Number.isNaN(seasonNumber) && seasonNumber < 100
const seasonNumberIsValid = !Number.isNaN(seasonNumber) && seasonNumber < 100
season = String(seasonNumberIsValid ? seasonNumber : 1).padStart(2, '0')
episode = String(+episode).padStart(3, '0')
if (!episode || !season)
Expand Down

0 comments on commit 4004870

Please sign in to comment.