Update Movie category in bulk Video Station

From Luniwiki
Jump to: navigation, search

Synology Video station database

# psql -U postgres -d video_metadata
psql (11.11)
Type "help" for help.
video_metadata=# \dt
                     List of relations
 Schema |            Name            | Type  |    Owner
--------+----------------------------+-------+--------------
 public | actor                      | table | VideoStation
 public | backdrop                   | table | VideoStation
 public | collection                 | table | VideoStation
 public | collection_has_library     | table | VideoStation
 public | collection_map             | table | VideoStation
 public | collection_sharing         | table | VideoStation
 public | collection_smart           | table | VideoStation
 public | config                     | table | VideoStation
 public | director                   | table | VideoStation
 public | gnere                      | table | VideoStation
 public | home_video                 | table | VideoStation
 public | library                    | table | VideoStation
 public | library_privilege          | table | VideoStation
 public | mapper                     | table | VideoStation
 public | movie                      | table | VideoStation
 public | offline_conversion_queue   | table | VideoStation
 public | offline_conversion_setting | table | VideoStation
 public | parental_control_setting   | table | VideoStation
 public | plus_info                  | table | VideoStation
 public | poster                     | table | VideoStation
 public | preprocess_video_queue     | table | VideoStation
 public | summary                    | table | VideoStation
 public | thumbnail                  | table | VideoStation
 public | tv_record                  | table | VideoStation
 public | tvshow                     | table | VideoStation
 public | tvshow_episode             | table | VideoStation
 public | user_hide_library          | table | VideoStation
 public | video_file                 | table | VideoStation
 public | vsuser                     | table | VideoStation
 public | watch_status               | table | VideoStation
 public | writer                     | table | VideoStation
(31 rows)

The field certificate in table movie or tvshow_episode is the movie category (PG, R).

Example update all episodes from TV show

First, we retrieve the tv show id

video_metadata=# select id, title from tvshow where title like 'PAW%';
  id   |   title
-------+------------
 11119 | PAW Patrol
(1 row)

and we update all episodes in bulk.

video_metadata=# update tvshow_episode set certificate='TV-Y' where tvshow_id=11119;
UPDATE 216

References

Daniel Simao 12:42, 9 January 2024 (EST)