mirror of
				https://github.com/vdr-projects/vdr.git
				synced 2025-03-01 10:50:46 +00:00 
			
		
		
		
	Now touching the .update file in the video directory after removing deleted recordings
This commit is contained in:
		
							
								
								
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								HISTORY
									
									
									
									
									
								
							| @@ -9390,3 +9390,6 @@ Video Disk Recorder Revision History | ||||
| - Fixed updating the cursor position when switching channels with the Channel+/- keys | ||||
|   while the Channels menu is open. | ||||
| - Fixed handling shared CA pids (thanks to Onur Sent<6E>rk). | ||||
| - Now touching the .update file in the video directory after removing deleted | ||||
|   recordings, so that other VDRs that use the same video directory will update their | ||||
|   list of (deleted) recordings and thus won't display too much empty disk space. | ||||
|   | ||||
							
								
								
									
										26
									
								
								recording.c
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								recording.c
									
									
									
									
									
								
							| @@ -4,7 +4,7 @@ | ||||
|  * See the main source file 'vdr.c' for copyright information and | ||||
|  * how to reach the author. | ||||
|  * | ||||
|  * $Id: recording.c 4.23 2019/03/17 16:01:13 kls Exp $ | ||||
|  * $Id: recording.c 4.24 2019/03/19 15:56:58 kls Exp $ | ||||
|  */ | ||||
|  | ||||
| #include "recording.h" | ||||
| @@ -99,27 +99,33 @@ void cRemoveDeletedRecordingsThread::Action(void) | ||||
|   if (LockFile.Lock()) { | ||||
|      time_t StartTime = time(NULL); | ||||
|      bool deleted = false; | ||||
|      bool interrupted = false; | ||||
|      LOCK_DELETEDRECORDINGS_WRITE; | ||||
|      for (cRecording *r = DeletedRecordings->First(); r; ) { | ||||
|          if (cIoThrottle::Engaged()) | ||||
|             return; | ||||
|          if (time(NULL) - StartTime > MAXREMOVETIME) | ||||
|             return; // don't stay here too long | ||||
|          if (cRemote::HasKeys()) | ||||
|             return; // react immediately on user input | ||||
|             interrupted = true; | ||||
|          else if (time(NULL) - StartTime > MAXREMOVETIME) | ||||
|             interrupted = true; // don't stay here too long | ||||
|          else if (cRemote::HasKeys()) | ||||
|             interrupted = true; // react immediately on user input | ||||
|          if (interrupted) | ||||
|             break; | ||||
|          if (r->Deleted() && time(NULL) - r->Deleted() > DELETEDLIFETIME) { | ||||
|             cRecording *next = DeletedRecordings->Next(r); | ||||
|             r->Remove(); | ||||
|             DeletedRecordings->Del(r); | ||||
|             r = next; | ||||
|             deleted = true; | ||||
|             continue; | ||||
|             } | ||||
|          r = DeletedRecordings->Next(r); | ||||
|          else | ||||
|             r = DeletedRecordings->Next(r); | ||||
|          } | ||||
|      if (deleted) { | ||||
|         const char *IgnoreFiles[] = { SORTMODEFILE, TIMERRECFILE, NULL }; | ||||
|         cVideoDirectory::RemoveEmptyVideoDirectories(IgnoreFiles); | ||||
|         cRecordings::TouchUpdate(); | ||||
|         if (!interrupted) { | ||||
|            const char *IgnoreFiles[] = { SORTMODEFILE, TIMERRECFILE, NULL }; | ||||
|            cVideoDirectory::RemoveEmptyVideoDirectories(IgnoreFiles); | ||||
|            } | ||||
|         } | ||||
|      } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user