feat: Add hide video feature and translations
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
# Change Log
|
||||
|
||||
## v1.6.42 (2025-12-23)
|
||||
|
||||
### Feat
|
||||
|
||||
- feat: Add hide video for visitor mode feature
|
||||
- feat: Add translations for hide video feature in all supported languages
|
||||
- feat: Add database migration for hidden video field
|
||||
|
||||
## v1.6.41 (2025-12-23)
|
||||
|
||||
### Feat
|
||||
|
||||
@@ -44,6 +44,13 @@ vi.mock('../../contexts/SnackbarContext', () => ({
|
||||
}),
|
||||
}));
|
||||
|
||||
const mockUpdateVideo = vi.fn();
|
||||
vi.mock('../../contexts/VideoContext', () => ({
|
||||
useVideo: () => ({
|
||||
updateVideo: mockUpdateVideo,
|
||||
}),
|
||||
}));
|
||||
|
||||
// Mock the child component to avoid sizing/visibility issues in JSDOM
|
||||
// and to easily verify props passed to it
|
||||
vi.mock('../VideoPlayer/VideoInfo/VideoKebabMenuButtons', () => ({
|
||||
|
||||
@@ -5,12 +5,14 @@ import { beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import * as CollectionContext from '../../contexts/CollectionContext';
|
||||
import * as LanguageContext from '../../contexts/LanguageContext';
|
||||
import * as SnackbarContext from '../../contexts/SnackbarContext';
|
||||
import * as VideoContext from '../../contexts/VideoContext';
|
||||
import VideoCard from '../VideoCard';
|
||||
|
||||
// Mock dependencies
|
||||
vi.mock('../../contexts/LanguageContext');
|
||||
vi.mock('../../contexts/CollectionContext');
|
||||
vi.mock('../../contexts/SnackbarContext');
|
||||
vi.mock('../../contexts/VideoContext');
|
||||
|
||||
const mockVideo = {
|
||||
id: '123',
|
||||
@@ -39,6 +41,9 @@ describe('VideoCard Kebab Menu', () => {
|
||||
removeFromCollection: vi.fn()
|
||||
} as any);
|
||||
vi.spyOn(SnackbarContext, 'useSnackbar').mockReturnValue({ showSnackbar: vi.fn() });
|
||||
vi.spyOn(VideoContext, 'useVideo').mockReturnValue({
|
||||
updateVideo: vi.fn().mockResolvedValue({ success: true }),
|
||||
} as any);
|
||||
});
|
||||
|
||||
it('renders kebab menu on hover (or always if mocked for test env)', () => {
|
||||
|
||||
@@ -204,7 +204,18 @@ const Home: React.FC = () => {
|
||||
|
||||
if (viewMode === 'history') {
|
||||
return videoArray
|
||||
.filter(video => video.lastPlayedAt)
|
||||
.filter(video => {
|
||||
// Must have lastPlayedAt
|
||||
if (!video.lastPlayedAt) return false;
|
||||
|
||||
// Apply tag filtering if tags are selected
|
||||
if (selectedTags.length > 0) {
|
||||
const videoTags = video.tags || [];
|
||||
return selectedTags.every(tag => videoTags.includes(tag));
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
.sort((a, b) => (b.lastPlayedAt || 0) - (a.lastPlayedAt || 0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user