From 3cc527484de6e297341b534c7654fcafcf667456 Mon Sep 17 00:00:00 2001 From: Nikolaj Schumacher Date: Sun, 4 May 2025 22:43:44 +0200 Subject: [PATCH 1/3] Fix .ignore file causing ignores outside the directory The file "a/.ignore" should only cause the directory "a" to be ignored. However, it also ignores all files starting with "a". After this fix, it will only ignore paths starting with "a/". --- server/utils/fileUtils.js | 2 +- test/server/utils/fileUtils.test.js | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/server/utils/fileUtils.js b/server/utils/fileUtils.js index 2c935557..f80c4acd 100644 --- a/server/utils/fileUtils.js +++ b/server/utils/fileUtils.js @@ -242,7 +242,7 @@ module.exports.recurseFiles = async (path, relPathToReplace = null) => { }) .filter((item) => { // Filter out items in ignore directories - if (directoriesToIgnore.some((dir) => item.fullname.startsWith(dir))) { + if (directoriesToIgnore.some((dir) => item.fullname.startsWith(dir + '/'))) { Logger.debug(`[fileUtils] Ignoring path in dir with .ignore "${item.fullname}"`) return false } diff --git a/test/server/utils/fileUtils.test.js b/test/server/utils/fileUtils.test.js index 59907be9..b57a6fb8 100644 --- a/test/server/utils/fileUtils.test.js +++ b/test/server/utils/fileUtils.test.js @@ -47,7 +47,7 @@ describe('fileUtils', () => { // Mock file structure with normalized paths const mockDirContents = new Map([ - ['/test', ['file1.mp3', 'subfolder', 'ignoreme', 'temp.mp3.tmp']], + ['/test', ['file1.mp3', 'subfolder', 'ignoreme', 'ignoremenot.mp3', 'temp.mp3.tmp']], ['/test/subfolder', ['file2.m4b']], ['/test/ignoreme', ['.ignore', 'ignored.mp3']] ]) @@ -59,7 +59,8 @@ describe('fileUtils', () => { ['/test/ignoreme', { isDirectory: () => true, size: 0, mtimeMs: Date.now(), ino: '4' }], ['/test/ignoreme/.ignore', { isDirectory: () => false, size: 0, mtimeMs: Date.now(), ino: '5' }], ['/test/ignoreme/ignored.mp3', { isDirectory: () => false, size: 1024, mtimeMs: Date.now(), ino: '6' }], - ['/test/temp.mp3.tmp', { isDirectory: () => false, size: 1024, mtimeMs: Date.now(), ino: '7' }] + ['/test/ignoremenot.mp3', { isDirectory: () => false, size: 1024, mtimeMs: Date.now(), ino: '7' }], + ['/test/temp.mp3.tmp', { isDirectory: () => false, size: 1024, mtimeMs: Date.now(), ino: '8' }] ]) // Stub fs.readdir @@ -103,7 +104,7 @@ describe('fileUtils', () => { it('should return filtered file list', async () => { const files = await fileUtils.recurseFiles('/test') expect(files).to.be.an('array') - expect(files).to.have.lengthOf(2) + expect(files).to.have.lengthOf(3) expect(files[0]).to.deep.equal({ name: 'file1.mp3', @@ -115,6 +116,15 @@ describe('fileUtils', () => { }) expect(files[1]).to.deep.equal({ + name: 'ignoremenot.mp3', + path: 'ignoremenot.mp3', + reldirpath: '', + fullpath: '/test/ignoremenot.mp3', + extension: '.mp3', + deep: 0 + }) + + expect(files[2]).to.deep.equal({ name: 'file2.m4b', path: 'subfolder/file2.m4b', reldirpath: 'subfolder', From fc33da447a5ece5ed1b38dfebf9973f706e5023b Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 9 May 2025 17:13:17 -0500 Subject: [PATCH 2/3] Remove unused album component --- client/components/app/BookShelfToolbar.vue | 5 - client/components/cards/LazyAlbumCard.vue | 142 --------------------- client/mixins/bookshelfCardsHelpers.js | 3 - 3 files changed, 150 deletions(-) delete mode 100644 client/components/cards/LazyAlbumCard.vue diff --git a/client/components/app/BookShelfToolbar.vue b/client/components/app/BookShelfToolbar.vue index 01ab4fa7..95e7c378 100644 --- a/client/components/app/BookShelfToolbar.vue +++ b/client/components/app/BookShelfToolbar.vue @@ -274,15 +274,10 @@ export default { isAuthorsPage() { return this.page === 'authors' }, - isAlbumsPage() { - return this.page === 'albums' - }, numShowing() { return this.totalEntities }, entityName() { - if (this.isAlbumsPage) return 'Albums' - if (this.isPodcastLibrary) return this.$strings.LabelPodcasts if (!this.page) return this.$strings.LabelBooks if (this.isSeriesPage) return this.$strings.LabelSeries diff --git a/client/components/cards/LazyAlbumCard.vue b/client/components/cards/LazyAlbumCard.vue deleted file mode 100644 index 9b722795..00000000 --- a/client/components/cards/LazyAlbumCard.vue +++ /dev/null @@ -1,142 +0,0 @@ - - - diff --git a/client/mixins/bookshelfCardsHelpers.js b/client/mixins/bookshelfCardsHelpers.js index 22a3556f..fc8a4125 100644 --- a/client/mixins/bookshelfCardsHelpers.js +++ b/client/mixins/bookshelfCardsHelpers.js @@ -3,7 +3,6 @@ import LazyBookCard from '@/components/cards/LazyBookCard' import LazySeriesCard from '@/components/cards/LazySeriesCard' import LazyCollectionCard from '@/components/cards/LazyCollectionCard' import LazyPlaylistCard from '@/components/cards/LazyPlaylistCard' -import LazyAlbumCard from '@/components/cards/LazyAlbumCard' import AuthorCard from '@/components/cards/AuthorCard' export default { @@ -20,7 +19,6 @@ export default { if (this.entityName === 'series') return Vue.extend(LazySeriesCard) if (this.entityName === 'collections') return Vue.extend(LazyCollectionCard) if (this.entityName === 'playlists') return Vue.extend(LazyPlaylistCard) - if (this.entityName === 'albums') return Vue.extend(LazyAlbumCard) if (this.entityName === 'authors') return Vue.extend(AuthorCard) return Vue.extend(LazyBookCard) }, @@ -28,7 +26,6 @@ export default { if (this.entityName === 'series') return 'cards-lazy-series-card' if (this.entityName === 'collections') return 'cards-lazy-collection-card' if (this.entityName === 'playlists') return 'cards-lazy-playlist-card' - if (this.entityName === 'albums') return 'cards-lazy-album-card' if (this.entityName === 'authors') return 'cards-author-card' return 'cards-lazy-book-card' }, From 257bf2ebe0808e1ab7485f58f62dce4b8e33269b Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 9 May 2025 17:24:02 -0500 Subject: [PATCH 3/3] Update edit chapters page breakpoint & cleanup padding --- client/pages/audiobook/_id/chapters.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/client/pages/audiobook/_id/chapters.vue b/client/pages/audiobook/_id/chapters.vue index 55f74b5c..e3c76da4 100644 --- a/client/pages/audiobook/_id/chapters.vue +++ b/client/pages/audiobook/_id/chapters.vue @@ -1,6 +1,6 @@