Skip to content

Commit d559fe7

Browse files
committed
revert back to 1.0.0
1 parent cc91cc9 commit d559fe7

File tree

4 files changed

+283
-218
lines changed

4 files changed

+283
-218
lines changed

README.md

+45-34
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,17 @@ Plex Image Cleanup has multiple Global Options to change how it runs these are s
147147

148148
### Example .env File
149149
```
150-
PLEX_URL=http://192.168.1.12:32400
151-
PLEX_TOKEN=123456789
152150
PLEX_PATH=C:\Plex Media Server
153151
MODE=report
154152
SCHEDULE=
153+
PLEX_URL=http://192.168.1.12:32400
154+
PLEX_TOKEN=123456789
155155
DISCORD=https://discord.com/api/webhooks/###################/####################################################################
156156
TIMEOUT=600
157157
SLEEP=60
158+
IGNORE_RUNNING=False
159+
LOCAL_DB=False
160+
USE_EXISTING=False
158161
PHOTO_TRANSCODER=False
159162
EMPTY_TRASH=False
160163
CLEAN_BUNDLES=False
@@ -165,59 +168,67 @@ LOG_REQUESTS=False
165168
166169
### Base Options
167170
168-
#### Plex URL & Token
169-
170-
The script will expect to connect to your Plex Server using your `Plex URL` and `Plex Token` Options ([Finding a Token](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/)).
171-
172-
* **Environment Variables:**
173-
174-
* `PLEX_URL=http://192.168.1.12:32400`
175-
176-
* `PLEX_TOKEN=123456789`
177-
178-
* **Shell Commands:**
179-
180-
* `-u "http://192.168.1.12:32400"` or `--url "http://192.168.1.12:32400"`
181-
182-
* `-t "123456789"` or `--token "123456789"`
183-
184171
#### Plex Path
185172
186-
The only other required Option is the `Plex Path` Option which is the Plex Config Directory containing the servers Metadata including `Cache`, `Metadata`, and `Plug-in Support`.
173+
The only required Option is the `Plex Path` Option which is the Plex Config Directory containing the servers Metadata including `Cache`, `Metadata`, and `Plug-in Support`.
187174
188175
To set the `Plex Path` for the run:
189-
190176
* **Environment Variable:** `PLEX_PATH=C:\Plex Media Server`
191-
192177
* **Shell Command:** `-p "C:\Plex Media Server"` or `--plex "C:\Plex Media Server"`
193-
194-
**Will also check `/plex` relative to the base directory of the script if neither of the above are specified.**
178+
* Will also check `/plex` relative to the base directory of the script if neither of the above are specified.
195179
196180
#### Mode
197181
198182
How Plex Image Cleanup runs depends on the `Mode` Option that's currently set for that run.
199183
200-
Here, "unused images" refers to unused uploaded images as described above.
184+
* `report`: Metadata Directory File changes will be reported but not performed.
185+
* `move`: Metadata Directory Files will be moved to the PIC Restore Directory. (CAN BE RESTORED)
186+
* `restore`: Restores the Metadata Directory Files from the PIC Restore Directory.
187+
* `clear`: Clears out the PIC Restore Directory. (CANNOT BE RESTORED)
188+
* `remove`: Metadata Directory Files will be removed. (CANNOT BE RESTORED)
189+
* `nothing`: Metadata Directory Files will not even be looked at.
201190
202-
* `report`: Reports statistics on unused images [count, size] but takes no action on them [like moving or deleting].
191+
To set the Global `Mode` for the run:
192+
* **Environment Variable:** `MODE=remove`
193+
* **Shell Command:** `-m remove` or `--mode remove`
203194
204-
* `move`: Moves unused images to the PIC Restore Directory. From there they can be `restore`d or `clear`ed.
195+
### Database
205196
206-
* `restore`: Restores the unused images from the PIC Restore Directory [as created by `move`] to the Metadata Directory. This restores Plex to its state prior to running PIC.
197+
The script needs to query the server's plex database to make sure it doesn't remove actively selected images.
207198
208-
* `clear`: Deletes the unused images from the PIC Restore Directory [as created by `move`]. (CANNOT BE UNDONE)
199+
#### Download From Plex API
209200
210-
* `remove`: Deletes the unused images from the Metadata Directory immediately, without the stop in the PIC Restore Directory. (CANNOT BE UNDONE)
201+
By default, the script will expect to connect to your Plex Server to download the Database using your `Plex URL` and `Plex Token` Options ([Finding a Token](https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/)).
211202
212-
* `nothing`: Does nothing with unused images; no report, no action.
203+
* **Environment Variables:**
204+
* `PLEX_URL=http://192.168.1.12:32400`
205+
* `PLEX_TOKEN=123456789`
206+
* **Shell Commands:**
207+
* `-u "http://192.168.1.12:32400"` or `--url "http://192.168.1.12:32400"`
208+
* `-t "123456789"` or `--token "123456789"`
213209
214-
To set the Global `Mode` for the run:
210+
#### Copy From Local
215211
216-
* **Environment Variable:** `MODE=remove`
212+
Alternatively the database can be copied from your local config directory you supplied in the [`Plex Path`](#plex-path) Option by using the `Local DB` Option.
217213
218-
* **Shell Command:** `-m remove` or `--mode remove`
214+
* **Environment Variable:** `LOCAL_DB=True`
215+
* **Shell Command:** `-l` or `--local`
216+
217+
**IMPORTANT! When Copying the Local Database, it is recommended to restart Plex before running this script and to make sure Plex is idle.**
218+
219+
Restarting allows for all temp SQLite files to be written to the primary Plex DB ensuring that all currently selected posters are properly known and preserved.
220+
221+
The script will not run when the temp SQLite files are found. To ignore this error, use the `Ignore Running` Option.
222+
223+
* **Environment Variable:** `IGNORE_RUNNING=True`
224+
* **Shell Command:** `-i` or `--ignore`
225+
226+
#### Use Existing
227+
228+
A previously downloaded or copied database can be used if it's less than 2 hours old by using the `Use Existing` Option. If the database is more than 2 hours old a new one will be downloaded or copied.
219229
220-
**NOTE: `report` is the default mode if you do not specify a mode.**
230+
* **Environment Variable:** `USE_EXISTING=True`
231+
* **Shell Command:** `-e` or `--existing`
221232
222233
### Other Operations
223234

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.1
1+
1.0.2!

config/example.env

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
PLEX_URL=http://192.168.1.12:32400
2-
PLEX_TOKEN=123456789
31
PLEX_PATH=C:\Plex Media Server
42
MODE=report
53
SCHEDULE=
4+
PLEX_URL=http://192.168.1.12:32400
5+
PLEX_TOKEN=123456789
66
DISCORD=https://discord.com/api/webhooks/###################/####################################################################
77
TIMEOUT=600
88
SLEEP=60
9+
IGNORE_RUNNING=False
10+
LOCAL_DB=False
11+
USE_EXISTING=False
912
PHOTO_TRANSCODER=False
1013
EMPTY_TRASH=False
1114
CLEAN_BUNDLES=False

0 commit comments

Comments
 (0)