mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2024-08-14 23:57:27 +00:00 
			
		
		
		
	Always create the watch history store on db upgrade
This commit is contained in:
		
							parent
							
								
									031fa6e45e
								
							
						
					
					
						commit
						8532b5e22d
					
				
					 2 changed files with 9 additions and 10 deletions
				
			
		
							
								
								
									
										1
									
								
								public/efy
									
										
									
									
									
										Submodule
									
								
							
							
						
						
									
										1
									
								
								public/efy
									
										
									
									
									
										Submodule
									
								
							| 
						 | 
				
			
			@ -0,0 +1 @@
 | 
			
		|||
Subproject commit 64c903b6bf21ed8c3f6259f7b8e02266968b91db
 | 
			
		||||
							
								
								
									
										18
									
								
								src/App.vue
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								src/App.vue
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -46,16 +46,14 @@ export default {
 | 
			
		|||
            request.onupgradeneeded = ev => {
 | 
			
		||||
                const db = request.result;
 | 
			
		||||
                console.log("Upgrading object store.");
 | 
			
		||||
                if (this.getPreferenceBoolean("watchHistory", false)) {
 | 
			
		||||
                    if (!db.objectStoreNames.contains("watch_history")) {
 | 
			
		||||
                        const store = db.createObjectStore("watch_history", { keyPath: "videoId" });
 | 
			
		||||
                        store.createIndex("video_id_idx", "videoId", { unique: true });
 | 
			
		||||
                        store.createIndex("id_idx", "id", { unique: true, autoIncrement: true });
 | 
			
		||||
                    }
 | 
			
		||||
                    if (ev.oldVersion < 2) {
 | 
			
		||||
                        const store = request.transaction.objectStore("watch_history");
 | 
			
		||||
                        store.createIndex("watchedAt", "watchedAt", { unique: false });
 | 
			
		||||
                    }
 | 
			
		||||
                if (!db.objectStoreNames.contains("watch_history")) {
 | 
			
		||||
                    const store = db.createObjectStore("watch_history", { keyPath: "videoId" });
 | 
			
		||||
                    store.createIndex("video_id_idx", "videoId", { unique: true });
 | 
			
		||||
                    store.createIndex("id_idx", "id", { unique: true, autoIncrement: true });
 | 
			
		||||
                }
 | 
			
		||||
                if (ev.oldVersion < 2) {
 | 
			
		||||
                    const store = request.transaction.objectStore("watch_history");
 | 
			
		||||
                    store.createIndex("watchedAt", "watchedAt", { unique: false });
 | 
			
		||||
                }
 | 
			
		||||
                if (!db.objectStoreNames.contains("playlist_bookmarks")) {
 | 
			
		||||
                    const store = db.createObjectStore("playlist_bookmarks", { keyPath: "playlistId" });
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue