Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete emptied directories when 'Move to TV Directory' #68

Closed
daveharris opened this issue Aug 20, 2013 · 5 comments
Closed

Delete emptied directories when 'Move to TV Directory' #68

daveharris opened this issue Aug 20, 2013 · 5 comments

Comments

@daveharris
Copy link
Member

When all files are moved from a directory, that directory and its parent should be deleted if they are empty so the user doesn't have to manually cleanup when putting files on a NAS or something from a temporary location

@davekeane
Copy link
Member

Deletion of that directory should be the default but configurable. Deletion
of the parent should not be be default, as it might be a target for some
other process which expects it to exist.

On 20 August 2013 22:24, Dave Harris notifications@github.com wrote:

When all files are moved from a directory, that directory and its parent
should be deleted if they are empty so the user doesn't have to manually
cleanup when putting files on a NAS or something from a temporary location


Reply to this email directly or view it on GitHubhttps://github.com//issues/68
.

@eprenamer
Copy link
Member

I have done this in my branch, though I didn't make it configurable (yet).

@eprenamer
Copy link
Member

My latest change implements this, but does so unilaterally. It doesn't give the user the option to leave the directories behind.

@eprenamer
Copy link
Member

I have modified it so that the default is now to not delete the directories, in order to preserve the old behavior.

The functionality is there to have this behavior, but it is still not exposed to the user through the UI.

Until it's exposed via the UI, savvy users can get this behavior by editing ~/.tvrenamer/prefs.xml by hand, adding:

<removeEmptiedDirectories>true</removeEmptiedDirectories>

Leaving this issue open until the behavior is exposed via the UI

@eprenamer eprenamer changed the title Delete empty directories when 'Move to TV Directory' Delete emptied directories when 'Move to TV Directory' Jan 16, 2018
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jan 17, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
@eprenamer
Copy link
Member

Included in PR #315

Note, this deletes emptIED directories, not necessarily empty ones. If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting). This only checks directories for emptiness after a file has been moved out of it.

eprenamer added a commit that referenced this issue Jan 17, 2018
The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jan 26, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jan 30, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jan 30, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jan 30, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jan 30, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 4, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 6, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 6, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 6, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 7, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 7, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 7, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 7, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 7, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 8, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 9, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 9, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 9, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer added a commit to eprenamer/tvrenamer that referenced this issue Jun 9, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
eprenamer pushed a commit to eprenamer/tvrenamer that referenced this issue Jun 17, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Jun 17, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Jun 18, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Jun 18, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Jun 20, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Jun 25, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Jun 25, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Jun 26, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Jun 26, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Oct 21, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Oct 21, 2018
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Oct 22, 2018
The only class that currently implements AddEpisodeListener is ResultsTable, and it already had a "refresh" method.  But, rename the method to be a bit more generic, make it public, and make it part of the AddEpisodeListener interface.

Make EpisodeDb an observer of changes to "ignore keywords"

Not really used yet; will be improved in next commit.

Issue tvrenamer#310: handle "ignore keywords" in episode db

Now ResultsTable doesn't know anything specifically about keywords to ignore.  That's handled in the model, now.

EpisodeDb is now the class that determines whether a file should be ignored.

We don't literally "ignore" the file.  We still try to parse it, look up the show, and look up the listings.  We "ignore" it at the point of presenting the options.  If we are supposed to be ignoring it, we do not provide the replacement options.  We provide a status message indicating why it's being ignored.

We use the EpisodeDb's subscription to UserPreferences to update the table dynamically if the user changes "ignore keywords" while the program is running.

Issue tvrenamer#99: add unparsed episodes to table.

Previously, when we couldn't parse a filename (i.e., extract presumed show name, season number, and episode number), we quietly omitted it.

Now, we'll add it to the table.  We already had code to handle it and to display a message that it couldn't be parsed.

Present options for DVD or Air on a per-episode basis (tvrenamer#261)

For show/placement specifications which have different valid values for DVD and Air ordering, store both internally, and be able to query for all episodes at a given placement, not just the "preferred" one.

When displaying episodes in the table, we have the UI use the DVD as the default, but make the table cell a combo box that allows the user to choose the alternate episode.

The combo box is not truly part of the cell from the Table's perspective.  It lives on top of the cell, and obscures it.  So when getting the value of the cell (as for sorting), we have to first make a distinction between a text cell and a combo box, and then get the right value, depending.

When sorting, we sometimes delete the TableItem and re-create it in a different spot.  But we re-use the combo-box item, rather than creating a new one.

Replace hasOptions and isReady with optionCount

This kind of makes things a little lower-level, but clearer about what exactly we're checking on.

Recreate replacementOptions when table is refreshed

It used to be that every time we constructed a table item, we re-created the "destination" string.  A recent change essentially cached that information in an instance variable.  But there are times when we need to explicitly refresh it.  For example, if the user modifies any of several preferences relating to the renaming scheme, we need to reconstruct the destination.

When the "destination" was actually just a status message, we can assume it doesn't need to be refreshed.  We only need to refresh if the seriesStatus is SeriesStatus.GOT_LISTINGS.  Add a new, public method to FileEpisode that will recreate the replacementOptions when SeriesStatus.GOT_LISTINGS, and call it from refreshAll.

Move code in UIStarter and ResultsTable

Add failTableItem method to ResultsTable

Issue tvrenamer#68, Delete emptied directories when 'Move to TV Directory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Change checkDestinationDirectory to use static UserPreferences

It used to be that UIUtils.checkDestinationDirectory took an instance of UserPreferences, kind of with the idea that if we wanted to reject the directory, we would not let the new instance of UserPreferences become effective.  But the reality is that we always have a singleton instance, and so it's already taken effect, and there was no way to reject it, so just let UIUtils have a static reference to the singleton instance, and use that.

Use static var for UserPreferences in several classes

It's a singleton class, so there's no reason for every instance of a class to have its own link.
johnv02139 added a commit to johnv02139/tvrenamer that referenced this issue Oct 22, 2018
The only class that currently implements AddEpisodeListener is ResultsTable, and it already had a "refresh" method.  But, rename the method to be a bit more generic, make it public, and make it part of the AddEpisodeListener interface.

Make EpisodeDb an observer of changes to "ignore keywords"

Not really used yet; will be improved in next commit.

Issue tvrenamer#310: handle "ignore keywords" in episode db

Now ResultsTable doesn't know anything specifically about keywords to ignore.  That's handled in the model, now.

EpisodeDb is now the class that determines whether a file should be ignored.

We don't literally "ignore" the file.  We still try to parse it, look up the show, and look up the listings.  We "ignore" it at the point of presenting the options.  If we are supposed to be ignoring it, we do not provide the replacement options.  We provide a status message indicating why it's being ignored.

We use the EpisodeDb's subscription to UserPreferences to update the table dynamically if the user changes "ignore keywords" while the program is running.

Issue tvrenamer#99: add unparsed episodes to table.

Previously, when we couldn't parse a filename (i.e., extract presumed show name, season number, and episode number), we quietly omitted it.

Now, we'll add it to the table.  We already had code to handle it and to display a message that it couldn't be parsed.

Present options for DVD or Air on a per-episode basis (tvrenamer#261)

For show/placement specifications which have different valid values for DVD and Air ordering, store both internally, and be able to query for all episodes at a given placement, not just the "preferred" one.

When displaying episodes in the table, we have the UI use the DVD as the default, but make the table cell a combo box that allows the user to choose the alternate episode.

The combo box is not truly part of the cell from the Table's perspective.  It lives on top of the cell, and obscures it.  So when getting the value of the cell (as for sorting), we have to first make a distinction between a text cell and a combo box, and then get the right value, depending.

When sorting, we sometimes delete the TableItem and re-create it in a different spot.  But we re-use the combo-box item, rather than creating a new one.

Replace hasOptions and isReady with optionCount

This kind of makes things a little lower-level, but clearer about what exactly we're checking on.

Recreate replacementOptions when table is refreshed

It used to be that every time we constructed a table item, we re-created the "destination" string.  A recent change essentially cached that information in an instance variable.  But there are times when we need to explicitly refresh it.  For example, if the user modifies any of several preferences relating to the renaming scheme, we need to reconstruct the destination.

When the "destination" was actually just a status message, we can assume it doesn't need to be refreshed.  We only need to refresh if the seriesStatus is SeriesStatus.GOT_LISTINGS.  Add a new, public method to FileEpisode that will recreate the replacementOptions when SeriesStatus.GOT_LISTINGS, and call it from refreshAll.

Move code in UIStarter and ResultsTable

Add failTableItem method to ResultsTable

Issue tvrenamer#68, Delete emptied directories when 'Move to TV Directory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Change checkDestinationDirectory to use static UserPreferences

It used to be that UIUtils.checkDestinationDirectory took an instance of UserPreferences, kind of with the idea that if we wanted to reject the directory, we would not let the new instance of UserPreferences become effective.  But the reality is that we always have a singleton instance, and so it's already taken effect, and there was no way to reject it, so just let UIUtils have a static reference to the singleton instance, and use that.

Use static var for UserPreferences in several classes

It's a singleton class, so there's no reason for every instance of a class to have its own link.
johnv02139 pushed a commit to eprenamer/tvrenamer that referenced this issue Jan 31, 2021
…tory'

The functionality actually has been present since last May.  Finally added the UI.  :-)  Simply a checkbox, on a separate line, between "Recursively add shows" and "Check for Updates".

Now that there's a UI to control it, make the default be to delete emptied directories.  Users can change the setting with the preferences dialog.

Note, this deletes emptIED directories, not necessarily empty ones.  If the user adds a folder, and the folder contains an empty subfolder, that subfolder will not be removed (regardless of setting).  This only checks directories for emptiness after a file has been moved out of it.

Conflicts:
	src/main/org/tvrenamer/model/UserPreferences.java
	src/main/org/tvrenamer/view/PreferencesDialog.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants